Updating multiple select with ajax
The method library is put into practice in the demonstration below. The Java Script code is sufficient to change the list of options of a SELECT.
This demo shows how to modify the list of options for a SELECT tag in an HTML form. Ajax allows the code to load a predefined list or to save the new modified list.
If a customer is selected, the show Customer() function executes the following: The page on the server called by the Java Script above is an ASP file called "getcustomer.asp".
I am building a website using j Query mobile which involves a form.
Depending on which categories are selected will determine what other form options will be displayed using AJAX.
The select box looks like this: Edit: SOLVED , but that's really up to you whether you want this function to run when the element is clicked, or its value is truly changed..can reduce some unnecessary calls.
When the contents of the list is saved, the submit button of the form is activated delayed, but this is an option for the demo, and is independent of the purpose of this article.If you are familiar with using select boxes for categorisation and sub-categories, such as ebay does when selling an item, usually this can require a lot of Java Script to maintain the select boxes, but j Query can hugely simplify this task by adding a dash of AJAX.Our demo will specifically look to build a simple form that allows us to book human resource for a project.NET AJAX Update Panel control provides two properties that you may use to update multiple regions of a Web page in response to a single client-side event.The Update Mode property may be set to Always, in which case the panel will always update during a post back, or set to Conditional, in which case the panel will only update in response to specific events.