user4fun Posted September 17, 2007 Share Posted September 17, 2007 My javascripts are not working in firefox?they are simlpe functions, they jsut check that a field has data in them before the submit button takes place. Link to comment Share on other sites More sharing options...
boen_robot Posted September 17, 2007 Share Posted September 17, 2007 Your code please. Link to comment Share on other sites More sharing options...
user4fun Posted September 17, 2007 Author Share Posted September 17, 2007 <script language="javascript" type="text/javascript">function validateForm(register){if(""==document.forms.register.FName.value){alert("Please enter your first name.");return false;}} and it gets repeated for other fields.tested in IE and they all work Link to comment Share on other sites More sharing options...
justsomeguy Posted September 18, 2007 Share Posted September 18, 2007 What does the form tag look like? Link to comment Share on other sites More sharing options...
user4fun Posted September 19, 2007 Author Share Posted September 19, 2007 <form name="register" method="post" action="registration_confirm.php" onSubmit="return validateForm(register);"> Link to comment Share on other sites More sharing options...
justsomeguy Posted September 19, 2007 Share Posted September 19, 2007 Give the form an ID in addition to the name. And instead of this:return validateForm(register);do this:return validateForm(this);Then you can change your function to this: function validateForm(frm){ if(""==frm.FName.value) { alert("Please enter your first name."); return false; }} Make sure the text field also has an id. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.