Turkish Property - Debt Consolidation - Debt Consolidation - Wordpress Themes - Find jobs

PDA

View Full Version : Problem between JavaScripts and Mozilla, PLZ help !


brajeshnepal
Feb 9th 2007, 1:02 am
I have a validation script that works fine with Internet explorer but has problem while executing action with Mozilla. Blow are my validation scripts and submit (action scripts) :

<script language="javascript">

function check()
{
var first_name=reservation.first_name.value;
var surname=reservation.surname.value;
var email=reservation.email.value;
var security=reservation.security.value;
var h_security=reservation.h_security.value;


if(first_name==null || first_name=="")
{
alert("Please Enter Your First Name");
reservation.first_name.focus();
return false;
}

else
if(surname==null || surname=="")
{
alert("Please Enter Your Surname");
reservation.surname.focus();
return false;
}

else
if(email==null || email=="")
{
alert("Please Enter Your Email Address");
reservation.email.focus();
return false;
}
else
if(security!=h_security)
{
alert("Please Enter Correct Security No");
reservation.security.focus();
return false;
}
return true;


}

</script>



Submit Button Scripts :
<input name="B1" type="submit" class="forms" value="Submit" onclick="return check()">


What's the problem guys ?????

Is it because I have other scripts above the one I am having problem with ??

designcode
Feb 9th 2007, 2:06 am
Hey brajeshnepal,

What exactly is reservation? Is it a form object declared above function?
Try after changing
var first_name=reservation.first_name.value;
to
var first_name=document.reservation.first_name.value;

May be it works for you.

brajeshnepal
Feb 9th 2007, 2:41 am
Hey brajeshnepal,

What exactly is reservation? Is it a form object declared above function?
Try after changing
var first_name=reservation.first_name.value;
to
var first_name=document.reservation.first_name.value;

May be it works for you.

Thanks designcode it worked . Many thanks once again.

designcode
Feb 9th 2007, 2:51 am
You're welcome :), I am glad that your problem is solved.