Preselected/PreFilled radio button based on data stored in our db
Posted on 2004-08-13
I have a query that retrieves user information from our db.
This information or data is displayed on an edit page. Basically we query our db to get the users information that they wish to edit. We pre-fill the form fields accordingly.
I am able to prefill text boxes and drop downs fine, but how can I pre-select a radio button based on the query?
So if there are two radio buttons, typeA and typeB, and user chose typeB initially. Then the user wants to edit their record, so they click the edit link, the page is displayed with all the users info pre-filled. How can I prefill the radio button?
currently my radio button looks like:
<input name="locationType" type="radio" value="TypeB">
For text boxes I do a <cfoutput>#FieldName#</cfoutput> in the value attribute of the input tag, but in the case of the radio button, I have already used the value attribute if that makes any sense..
Help highly appreciated as always