Welcome Guest, Not a member yet? Register   Sign In
Form Validation - set_select() - on a dynamically generated select control
#1

[eluser]osfan[/eluser]
Hi Guys,

Still struggling to work out the best way to enable a dynamically generated select control to show the value that was selected when the form is posted and validation is not completed.

I.E. the form has various mandatory fields, one field is a select control that is created from rows in a database table. The user selects an option on the select control, forgets to fill in the mandatory fields and submits the form.

The form runs validation and returns with the errors for the mandatory fields, so far so easy. What I need to do is to ensure that the select control displays the value that the user selected before submitting the form.

This would be easy if the select control was not dynamically generated using set_select(), but I can't get it working when I create the select control from rows retrieved from a database table.

Can anyone give me an idea what the best way forward would be please ?

Many thanks




Theme © iAndrew 2016 - Forum software by © MyBB