Well, I'm getting an error. Here is the function, what, according to FF's consolde is generating the error.
The line getting selected by the FF console is
The line that's calling the function is -
The first line of form is -
The error is -
document.ededfi l has no properties (FF)
document.ededfi l.nationalite is null or not an object (IE)
Note: I've similar functions elsewhere in the site. The javascript file is an external file. I am calling the javascript file through top.php file, ie, the sama javascript is available to all my site. Is it due to any problem of mismatching between different javascript code or I am doing some error?
Another point. This form appears inside a php condition. Means, the form comes into existence depending on if certain conditions are met. Do you guys think that this may be the reason of this problem?
If this is the reason, i'll probably need a solution like
Thanks for any help guys. I would love to get a workaround here ... :)
Code:
function citizen3()
{
if (document.ededfil.nationalite[0].checked == true) {
document.ededfil.pays_origine[0].checked = true;
document.ededfil.pays_origine[0].disabled = true;
document.ededfil.pays_origine[1].disabled = true;
document.ededfil.pays_origine[2].disabled = true;
} else if (document.ededfil.nationalite[1].checked == true) {
document.ededfil.pays_origine[0].checked = false;
document.ededfil.pays_origine[0].disabled = false;
document.ededfil.pays_origine[1].disabled = false;
document.ededfil.pays_origine[2].disabled = false;
}
}
Code:
if (document.ededfil.nationalite[0].checked == true) {
Code:
<input type="radio" name="nationalite" <? If ($nationalite == "Française") { ?> checked <? }?> value="Française" onClick="citizen3();"> Autre <input type="radio" name="nationalite" <? If ($nationalite == "Autre") { ?> checked <? }?> value="Autre" onClick="citizen3();">
Code:
<form name="ededfil" id="ededfil" method="post" action="<?=$_SERVER['PHP_SELF']?>" enctype="multipart/form-data">
document.ededfi l has no properties (FF)
document.ededfi l.nationalite is null or not an object (IE)
Note: I've similar functions elsewhere in the site. The javascript file is an external file. I am calling the javascript file through top.php file, ie, the sama javascript is available to all my site. Is it due to any problem of mismatching between different javascript code or I am doing some error?
Another point. This form appears inside a php condition. Means, the form comes into existence depending on if certain conditions are met. Do you guys think that this may be the reason of this problem?
If this is the reason, i'll probably need a solution like
Code:
if (some php conditions are met) {
//do something and call that function onclick
} else {
//do otherthings and also do something so that I don't get the ... [I]has no properties [/I] error.
}
Comment