How to fill in the fields of my form, if I select one of the values ββfrom the drop-down menu (the drop-down menu is obtained from the database) Somehow in my javascript I need to connect to the functions, since there are different tables with form fields.
Question
Do I need to set fields using $ field name?
if(document.id('LoadExtension') && document.id('ExtensionResponse')) { // id of select box var sel = document.id('LoadExtension'); // ser select box as var. sel.addEvent('change', function(chg) { // add change event to select box. if(sel.getSelected().get('value') != '') { // on change if selected value is not empty. new Request.HTML({ url : 'http://domain.co.nz/index.php?extension='+ sel.getSelected().get('value'), onRequest: function() { }, onComplete: function(r1, r2, html, js) { document.id('ExtensionResponse').set('html', html); } }).send(); } });
}
The above code was configured to go from another document to the url: field, but I would like to do this on one page.
source share