Hi all,
I have an AJAX script that pulls a radio group list from PHP. I would like to then read which of those options the user subsequently selects.
My AJAX script:
function showCharacteristics()
{
xmlhttp1=new XMLHttpRequest();
xmlhttp1.onreadystatechange=function()
{
if (xmlhttp1.readyState==4 && xmlhttp1.status==200)
{
document.getElementById("charList").innerHTML=xmlhttp1.responseText;
}
}
xmlhttp1.open("GET","ctrPanelProc.php?selection=getCharacteristics",true);
xmlhttp1.send();
}
My PHP script:
echo "<form id='frmShowChar' name='frmDelChar' action='' onsubmit='dellChar();'>";
$sql = "SELECT * FROM characteristic ORDER BY characteristic ASC";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
echo "<input type='radio' id='charID' name='charID' value='" . $row['characteristicID']
. "'/> " . $row['characteristic'] . "<br />" ;
}
echo "</form>";
I would like to be able to read the 'charID' value the user has selected and pass that to another function. How can I access this value? Thanks!
cmccully