While building a bunch of forms over the past few weeks, one thing I've failed to figure out is how to use the "Has depending fields" and "Depends on another field" checkboxes to alter other fields based on the selected value of the first field,
without causing a page reload.
Let's consider a customer RFQ form. At the top of the form, I collect a bunch of customer related data such as name, phone number, email, company, address, etc. Below that I have a few related drop-down fields for category and subcategory of interest, and further down, some more fields such as "how did you hear about us", and a captcha. Depending on what category the customer chooses from the first drop down, I want to populate the subcategory drop down with choices that apply to that category.
As I'm building the form in CMS Desk, I check the checkbox on the RFQCategory field for "Has depending fields", and set the options to something like:
Category ABC;Category ABC
Category DEF;Category DEF
...
Category XYZ;Category XYZ
Then, for the purposes of experimentation, I create several RFQSubcategoryABC, RFQSubcategoryDEF, RFQSubcategoryXYZ, etc. drop down fields with different options in each, check the checkbox for "Depends on another field", and set the visibility condition as this example shows:
RFQCategory.Value = "Category ABC"
And so on with the other subcategory fields. (Of course, ultimately, I'd like to create a custom table, put my subcategory choices there along with the category they're associated with, and use SQL to generate the list of available subcategory options, keeping the different subcategory fields in just one field.)
When the page initially loads, I see the category field and pick a subcategory from it.
Problem: As soon as I click on my choice, Kentico does a full page reload, and repositions the document at the top in the browser window, even though I was a screen or two down when I looked at the category field. And since I wasn't at the bottom of the form, now I've got to hunt to figure out where I was when the page reloaded.
The task of altering part of a web form based on choices made in some fields is not a new one, and has been solved outside of Kentico in several different ways: JavaScript to show/hide elements using their ID attributes where the depending fields are placed on the page but their visibility is set to not be shown, JavaScript to programmatically change the options listed in the depending fields, and more recently leveraging AJAX to make the page behavior feel more interactive. Kentico's behavior, on the other hand, appears to be limited to a postback with a full page reload in order to figure out that it needs to show one of the hidden fields.
Question: Is there any way to use the out of the box features in the CMS Desk or Site Manager to allow updates to depending fields without page reloads? If so, how?Thanks!