Page 1 of 1

Dynamically select option in select and radio form elements

Posted: Fri Apr 28, 2006 12:28 pm
by mattyboi
Hey guys, got another one for ya.

I have a form with the element values being populated dynamically by fields in a database table. In this form there are some select and radio elements.

How would I have the select element select the appropriate option based on the table when the page loads. The same for the radio element.

Thanks

Posted: Fri Apr 28, 2006 12:44 pm
by feyd
dynamically (in the page's source from the php side) add selected="selected" and checked="checked" to the corresponding option or radio button respectively.

Posted: Fri Apr 28, 2006 12:51 pm
by mattyboi
feyd wrote:dynamically (in the page's source from the php side)
I'm not quite sure what you mean by this.

Posted: Fri Apr 28, 2006 3:47 pm
by feyd