Jump to content

Validation Help


Recommended Posts

I need The top 4 feilds to be filled out, and the email feild to be in email format.

<html><head><title>Join New World Terror</title><link rel="stylesheet" type="text/css" href="css.css"></head><body><table width="100%"><tr valign="top"><td width="12%"><?php include("navbar.htm"); ?></td><td width="88%"><h2>Join New World Terror</h2><form name=form1 method=post action=register.php>   <table width=100% border=0 cellpadding=4 cellspacing=0>     <tr>      <td width=24% align=left valign=top><b>Clan Information*</b></td>    </tr>    <tr>       <td width=24% align=left valign=top>ESO Username</td>       <td width=36%><input name=ESO_username type=text id=ESO_username></td>       <td width=40%>This is the user name displayed on the site.  Required.</td>    </tr>    <tr>       <td width=24% align=left valign=top>Current ESO Games Played</td>       <td width=36%><input name=ESO_gamesplayed type=text id=ESO_gamesplayed></td>       <td width=40%>This also doesn't affect whether you are accepted, it is just for us to know how long you've been playing. Required</td>    </tr>     <tr>       <td width=24% align=left valign=top>Current ESO Win Percentage</td>       <td width=36%><input name=ESO_winpercent type=text id=ESO_winpercent></td>       <td width=40%>This also doesn't affect whether you are accepted, it is just for us to know your relative skill level. Required.</td>    </tr>    <tr>       <td width=24% align=left valign=top>Email Address</td>       <td width=36%><input name=email_address type=text id=email_address></td>       <td width=40%>You need to have a valid email address to join the clan and will be contacted though it. Required.</td>    </tr>    <tr>      <td width=24% align=left valign=top><b>Profile Information</b></td>    </tr>    <tr>       <td width=24% align=left valign=top>First Name</td>       <td width=36%><input name=first_name type=text id=first_name2></td>       <td width=40%>Required.</td>    </tr>     <tr>       <td width=24% align=left valign=top>Last Name</td>       <td width=36%><input name=last_name type=text id=last_name></td>       <td width=40%>NOT Required.</td>    </tr>     <tr>       <td width=24% align=left valign=top>Information about you:</td>       <td width=36%><textarea name=info id=info></textarea></td>       <td width=40%>Just to say a few things about yourself.  Not Required.</td>    </tr>     <tr>       <td align=left valign=top> </td>       <td><input type=submit name=Submit value='Submit' onclick="check()" ></td>     </tr>   </table> </form><b>*All Clan Information Feilds Requered.</b></td></body></html>

I've looked over the W3schools tutorial, and even look at other topics about this, but I can't figure it out. Thanks goes out to whoever helps. :)

Link to post
Share on other sites

you can check an input value like this

if(document.getElementById('inputFieldId').value.length < 1){    alert('you must fill in the is field!');}

and to make sure the email is in the proper format you could do this

var emailAddy = document.getElementById(EmailFieldId);if(emailAddy.indexOf('@') == -1 || emailAddy.indexOf('.') == -1){   alert('Not in proper email format!');}

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...