Jump to content
xisto Community
Sign in to follow this  
solankyno1

Javascript Problem Help Needed

Recommended Posts

dear friends,

I have made a Form page and I am using javascript for validating it . I don't want the textboxes to be blank. My code is working well in Internet Explorer but not in Firefox. the page is at http://www.webdirectory.co.nr/Emailform.html

the code is as following

<script type="text/javascript"> <!-- function formsubmit(){  if(formme.fromname.value==""){  alert("PLEASE ENTER YOUR NAME");  formme.fromname.focus();  return false;} if(formme.fromemail.value==""){  alert("PLEASE ENTER YOUR EMAIL");  formme.fromemail.focus();  return false;} if(formme.message.value==""){  alert("PLEASE ENTER WEBSITE WITH DESCRIPTION");  formme.message.focus();  return false;} return true;} //--></script>

Please help what is wrong with my code. Thanks in advance.

Share this post


Link to post
Share on other sites

So at last the problem was solved by me. I was not adding the word document before every form element. I mean I was writing form.input.value="" but i was supposed to write document.form.input.value="" . Internet Explorer was ignoring this problem it proves how standard the IE is.

Share this post


Link to post
Share on other sites

So at last the problem was solved by me. I was not adding the word document before every form element. I mean I was writing form.input.value="" but i was supposed to write document.form.input.value="" . Internet Explorer was ignoring this problem it proves how standard the IE is.

41659[/snapback]


actually, it just proves that you have to be very specific if you want all browsers to render your code correctly! there are many different levels other than 'document' in javascript. browsers never like to assume and they almost always do it badly!

 

more and more users are switching over to firefox because a lot of them (including myself) believe that it renders code way better! you'll just have to learn to code to both browsers!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.