|
|
|
|
![]() ![]() |
Jan 17 2005, 04:45 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 315 Joined: 1-October 04 From: India Member No.: 1,377 |
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 CODE <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. |
|
|
|
Jan 17 2005, 06:11 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 315 Joined: 1-October 04 From: India Member No.: 1,377 |
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.
|
|
|
|
Jan 17 2005, 10:07 PM
Post
#3
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 74 Joined: 21-October 04 From: Connecticut Member No.: 1,870 |
QUOTE(solankyno1 @ Jan 17 2005, 01:11 PM) 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. 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! |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th September 2008 - 06:33 PM |