Hi
I’m trying to get a form field value into a function and I’m not doing it right because it isn’t working
here’s the relevant code from the page :
[CODE]
<form action=”produits-frais-infos.php” name=”clientcoord” method=”post” onSubmit=”return checkrequired(this,’message’)”>
<input type=”radio” name=”deltype” value=”livr””.$check.”>
and the js function:
[CODE]function checkrequired(which, txt){
var radioButt = “”;
radioButt = which[“deltype”].value;
alert(“value = ” + radioButt);
//if(radioButt=”altadresse”){
var pass=true;
for (i=0;i<which.length;i++){
var tempobj=which.elements[i];
if (tempobj.name.substring(0,2)==”r_”){
if (((tempobj.type==”text”||tempobj.type==”textarea”||tempobj.type==”select-one”)&&tempobj.value==”)||(tempobj.type.toString().charAt(0)==”s”&&tempobj.selectedIndex==-1)){
pass=false;
break;
}
}
}
if (!pass){
alert(“Champ(s) obligatoire(s) : ” + txt + ” ! n Veuillez vérifier le(s) champ(s)”);
return false;
}else{
return true
}
//}else{
// return true
//}
}
I would just like to get the value of “deltype” radio button into the function but it’s not happening
can anyone suggest what i’m doing wrong here ?
thanks