Expand|Select|Wrap|Line Numbers
- 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;
- }
- }
Expand|Select|Wrap|Line Numbers
- if (document.ededfil.nationalite[0].checked == true) {
Expand|Select|Wrap|Line Numbers
- <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();">
Expand|Select|Wrap|Line Numbers
- <form name="ededfil" id="ededfil" method="post" action="<?=$_SERVER['PHP_SELF']?>" enctype="multipart/form-data">
document.ededfil has no properties (FF)
document.ededfil.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
Expand|Select|Wrap|Line Numbers
- 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 ... has no properties error.
- }