I have data being imported from a database and I would like to represent that data in a set of radio buttons. If the value in the database is 1 the “customer status” should show the “active” radio button else show the “inactive” button.
I don’t know much at all about JQuery but am learning day by day so any detailed help offered would be greatly appreciated.
I took the main code snippets from my files and am including them here.
The interesting thing about the code I am posting is that I can use the buttons to change the data in the database. That works but showing what is in the database isnt.
var admCustStatus = $("input[name='admCustStatus']:checked").val();
if (item.field == "admCustStatus")
{
// ?? radio buttons
}
<tr>
<td class="admMarker">Active<input type="radio" id="admCustStatusActive" name="admCustStatus" value="1" checked="checked" class="admChkbx"></td>
<td class="admMarker">Inactive<input type="radio" id="admCustStatusInactive" name="admCustStatus" value="0" class="admChkbx"></td>
</tr>
This may be what you’re looking for: