This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes validating user Input using java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "validating user Input using java script" Watch "validating user Input using java script" New topic
Author

validating user Input using java script

amrut sabade
Ranch Hand

Joined: Aug 16, 2010
Posts: 90
Hi everyone ... i have one registration form which contains text boxfor email and i have to validate wheather the entered email id is valid or not i ma using following script to validate on onblur event.. but its giving me error that object expected... please help ...whats is going wrong with it...
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Which line gives that error?

Also, can you try adding alert(inputField.value) to show that value isn't null. If it is null, show how you are calling the function.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
amrut sabade
Ranch Hand

Joined: Aug 16, 2010
Posts: 90
i am calling the function as onblur="return validateEmail()" and this line is giving error...
is it correct tocall function as this
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
amrut sabade wrote:i am calling the function as onblur="return validateEmail()" and this line is giving error...
is it correct tocall function as this


No, it is not correct, as in the first line you are doing inputField.value.length, if you call the function without the inputField argument this is undefined and it will throw an error in the very first line, try onblur="return validateEmail(this)" (in case you want to check the field where you are setting the onblur)

Also install the firebug plugin to help you create and debug javascript part of your application http://getfirebug.com/ and check the very useful screencasts here http://getfirebug.com/screencasts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validating user Input using java script
 
Similar Threads
how to encrypt the text
how to create small windows
SSL error
Choose drop down list option with more than one character?
catching ascii key codes in javascrip