I want one or the other of two radio buttons to be checked depending on a substring of an incoming value.
if the variable cOrder contains ID in the string then I want the first radio button checked if not then I want the second radio button checked.
In the sample code below I only show one radio button.
I am just not sure how to construct the td.innerHTML string?
if the variable cOrder contains ID in the string then I want the first radio button checked if not then I want the second radio button checked.
In the sample code below I only show one radio button.
I am just not sure how to construct the td.innerHTML string?
Code:
var cKeyChk = ( cOrder.indexOf("ID") == -1 ) ? true:false;
tr = tbody.insertRow(tbody.rows.length);
td = tr.insertCell(tr.cells.length);
td.setAttribute("nowrap", "nowrap");
td.setAttribute("align", "right");
td.innerHTML = '<INPUT'+
' type="radio"'+
' name="SearchMethod"'+
' id ="Contains"'+
' value="Contains"'+
if (cKeyChk)
{
' checked'+
}
'/>';
Comment