php - need to get value from the database and populate a drop down list using jquery -
Hello, I need to populate a drop down list when I select a certain value, and the option to databases Should I ask ..?
Can I get it from jquery? If I can do it, I would appreciate any help.
You can do it with jQuery and AJAX
jQuery.post ('dropdownValues.php', {parameterSentToServer1: 'value', param2: 'value2'}, function (data) {jQuery ('# mydropdown option'). Remove (); // Remove existing data (var option in data option) {jQuery ('# mydropdown') .Append ('' In dropdown value.FPP you will need to create a Jason object with the result of SQL query, the object should be in this format (to work with the above script):
resonance '{result: [[value: 1, name:' option1 '}, {value: 2, name:' option2 '}}};
Comments
Post a Comment