aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Email Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Email Validation" Watch "Email Validation" New topic
Author

Email Validation

vinay abhishek
Greenhorn

Joined: Nov 23, 2012
Posts: 18
I tried to have a javascript based EMAIL validation for a sign up page in my application and the java script is as follows(Reference:w3schools email validaton) When I use it in netbeans I get the following error in the IF loop line
"Fatal Error: The content of elements must consist of well-formed character data or markup." Please Help...

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

If the eclipse JavaScript validation is not going to give you accurate results, turn it off. Or use a better IDE.

It almost sounds as if it's trying to validate it as XML.

P.S. if statements are not "loops"


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

The code does have problems though, not the least of which is inconsistent return points.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18986
    
    8

Bear Bibeault wrote:It almost sounds as if it's trying to validate it as XML.


Perhaps the Javascript code is embedded in an XHTML document. In which case the editor would be complaining about the unescaped < characters, wouldn't it?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

It should be smart enough to know that inside a script block, that angle brackets are not elements.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

P.S. I still don't know why people are still using XHTML -- it's a dead horse. But then again, people are still using scriptlets in JSPs 10 years after their obsolescence!
 
wood burning stoves
 
subject: Email Validation