I have a question related to radio buttons. So I have form that user fill up and save in DB. User has option to email that form to them self. If users click on the link they should get the form with their information. At this point I was able to retrieve all text input values, problem for me is how to pass the value from DB to the group of radio buttons? Here is example of HTML code:
<cfquery name="jobInfo" datasource='test'>
SELECT jobCat
FROM userInfo
WHERE UserID = <cfqueryparam cfsqltype="cf_sql_integer" value="#RecID#">
</cfquery>
<cfoutput query="jobInfo">
<tr>
<th>Jobs</th>
</tr>
<tr>
<td>
<label>
<span><input type="radio" name="category" value="Teacher" id="teacher"></span>
<span>Teacher</span>
</label><br>
<label>
<span><input type="radio" name="category" value="Professor" id="professor"></span>
<span>Professor</span>
</label><br>
<label>
<span><input type="radio" name="category" value="Athletic" id="athletic"></span>
<span>Athletic Director</span>
</label>
<td/>
</tr>
</cfoutput>
then I tried to retrieve the value for the radio buttons like this:
<script>
$('input:radio[name="category"]').val('<cfoutput>#jobInfo.jobCat#</cfoutput>');
</script>
Query output:
<cfoutput>#jobInfo.jobCat#</cfoutput> gives me: Teacher
Usually I was able to get the values for check boxes if I used field id but in this case I have to pass the value to the group of radio buttons. If anyone knows what I'm doing wrong please let me know. Thanks.