Forums

ASP

This topic is locked

Radio Groups and text boxes O My

Posted 14 Mar 2006 20:10:15
1
has voted
14 Mar 2006 20:10:15 Neal T posted:
I am inputing the information gathered via radio groups into a DB. THIS works.

When my page comes up, it displays the appropriate information in a text box. Cool.

What I am having issues with, is making it so that the information in the text box will "check" the appropriate radio button when it loads. I am using ASP to code.

I am thinking I will need to go with a basic If...then statment, but havn't even the foggiest of where to begin. Would it be something like:

If radiobutton = textbox then
name_of_radiobutton = checked?

Actually, I think I just thought of how to do this, but if anyone has any feedback, it wuld be great.

Replies

Replied 15 Mar 2006 13:10:09
15 Mar 2006 13:10:09 Michael Behan replied:
Yeah sounds like you just about have it, it should go like this
<pre id=code><font face=courier size=2 id=code>
&lt;input type="radio" name="group" value="someValue"
&lt;%If Recordset.Fields.Item("fieldName".Value = "whatUWant"%&gt;checked
&lt;%End If%&gt;&gt;
</font id=code></pre id=code>

where recordset is the name of the recordset that has the text that correctly appears in your text field, and fieldName contains that text and whatUwant is the text that means the radio button should be checked.

Edited by - mbisme on 15 Mar 2006 13:11:18

Reply to this topic