View Single Post
Old 10-15-2012, 12:53 PM   PM User | #1
rexhvn
New Coder

 
Join Date: Oct 2011
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
rexhvn is an unknown quantity at this point
simple validation issue

Hi,

I learning javascript and now doing a simple validation however i'm coming across an issue. See code below

Html
Code:
<form name="loginsubmit" method="post" action="adproperties.html"></form>
Javascript
Code:
   <script>
   // this is for the login validation
   function loginvalidation()
   {
	if(document.loginsubmit.usernameform == '' );
	alert('Please enter your username');
	return false;
   }


   </script>
The issue that i'm having is when the username is submited with no text, the alert will appear, but even when I include text it still appears and doesn't go to the selected link.

Help would be appreciated.
rexhvn is offline   Reply With Quote