hello, i'm unable to get a radio value in a form loaded by ajax into a div. here is the javascript code i'm using. (the radio name is 'categorie_add' in get function)
function getCheckedValue(radioObj) {
if(!radioObj)
return "";
var radioLength = radioObj.length;
if(radioLength == undefined)
if(radioObj.checked)
return radioObj.value;
else
return "";
for(var i = 0; i < radioLength; i++) {
if(radioObj[i].checked) {
return radioObj[i].value;
}
}
return "";
}
function get(obj) {
var poststr ="cat_title=" + escape(encodeURI(document.getElementById("cat_title").value )) +
"&cat_description=" + escape(encodeURI( document.getElementById("cat_description").value ))+
"&cat_id=" + escape(encodeURI( getCheckedValue(document.categorie_add.cat_id) ));
makePOSTRequest('categorie.php', poststr);
}
and i have this in php file
echo '<li><input type="radio" name="cat_id" id="cat_id" value="' . $value['cat_id'] . '" /> ' . htmlentities($value['cat_title']) . '<br />';
thank you in advance for your answers.