Hi all,
I need to fill a large number of fields in a form depending on one first dropdown element. To be more complete a user, can have multiple records saved to a database. He can visualize them all, and go to a modify page, select one of them, get the current values in the form fields, modify them and then save it back to the database.
To do this I now created a dropdown and added a onchange event via html parameters. After this I can set all fields via javascript whenever the user chooses another record. However I fail to do this for a dropdown element. Appearently it does not use the default html select type with options, but some divs.
So my question how can I set a dropdown element via javascript? Or is there another way to get this to work. Doing a submit and reading a single record is not preferred due to other aspects in the form.
Any help appreciated. Pim
Hi Pim
You can put your fields inside a Container and add a Listener to that container and Reload it on the dropdown change, I think that may do what you need
Hi Max,
Tried this, but fails as well for a totally different reason. The solution indeed can handle my situation, however I also have buttons to do redirects and those will fail afterwards. The url is no extended with a output=ajax, causing redirects to load the new page without the exterior. Only the innerpart is returned.
I have chosen to for now forget the option requiring the dropdown to keep it easy for myself and also because it had some other implications on my side to deal with such changes outside the website.
So for others, yes the solution works unless you use redirects nextpage events elsewhere on your page.
It would be nice if there is a method to remove redirect parameters earlier set. It is more often an issue in my cases.
Kind regards,Pim
