koila
asked on
How do you display a checked a radio button data from the table into a form when the field is 'YES'
Hello,
I have a ColdFusion form and SQL Database. It's working fine. So when the user login, i'm able to display his data from the table into a textarea but I wasn't able to display the radio button checked and checkbox button checked.
so let start with the radio button and I will post another question for the checkbox.
reading_yes --> My form, when i load my form into my browser it show "YES" instead of the button checked
(X) yes ( )no
This is the code.
display-data.jpg
reading-yes.jpg
I have a ColdFusion form and SQL Database. It's working fine. So when the user login, i'm able to display his data from the table into a textarea but I wasn't able to display the radio button checked and checkbox button checked.
so let start with the radio button and I will post another question for the checkbox.
reading_yes --> My form, when i load my form into my browser it show "YES" instead of the button checked
(X) yes ( )no
This is the code.
<td colspan="2" height="5" width="100%"><cfoutput>#DisplayCVIToolvolunteer.contactme#<cfinput type="radio" name="contactMe" id="contactMeYes" value="Yes" required="true" message="Question 1: This field is required. Please select yes or no. Please try again." onClick="checkme(this);" />
<label for="ContactMeYes">Yes</label>
<cfinput type="radio" name="contactMe" id="contactMeNo" value="No" onClick="checkme(this);" />
No
</label>
<br>
<div id="specify" style="display:none;">
<label>Please specify:
<input type="text" name="ContactMeSpecify" id="ContactMeSpecify" value="" maxlength="255" size="30" style="width: 200px;border:red 1px solid;">
</label>
<p id="error" style="color:red;display:none;">Required input! Or else... click "No" above...</p>
</div></cfoutput></td>
SQL-Table-data.jpgdisplay-data.jpg
reading-yes.jpg
ASKER
Hello Agx,
Thank you for your note, I've add the code and I've loaded the form so the yes button didn't came checked according to the table entry? why.
(*) yes (no)
The contactme field char10, not null
contactme
Yes
Thank you for your time,
Thank you for your note, I've add the code and I've loaded the form so the yes button didn't came checked according to the table entry? why.
(*) yes (no)
The contactme field char10, not null
contactme
Yes
Thank you for your time,
ASKER
this is my code
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="qtable">
<tr>
<td colspan="2" height="5" width="100%"><cfinput type="radio" name="contactMe" id="contactMeYes" value="Yes" checked="#DisplayCVIToolvolunteer.contactme eq 'Yes'#" required="true" message="Question 1: This field is required. Please select yes or no. Please try again." onClick="checkme(this);" />
<label for="ContactMeYes">Yes</label>
<cfinput type="radio" name="contactMe" id="contactMeNo" value="No" checked="#DisplayCVIToolvolunteer.contactme eq 'no'#" onClick="checkme(this);" />
No
</label>
<br>
<div id="specify" style="display:none;">
<label>Please specify:
<input type="text" name="ContactMeSpecify" id="ContactMeSpecify" value="" maxlength="255" size="30" style="width: 200px;border:red 1px solid;">
</label>
<p id="error" style="color:red;display:none;">Required input! Or else... click "No" above...</p>
</div></td>
</tr>
</table>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you.
<cfinput type="radio" name="contactMe" value="Yes"
checked="#DisplayCVIToolvo
<cfinput type="radio" name="contactMe" value="No"
checked="#DisplayCVIToolvo