Jump to content

Making a field in a form *required


LittleNicky

Recommended Posts

Here, (btw, please respond to my pm).In the header:

<style type="text/javascript" language="javascript">IsEntered(input){var input= document.getElementById(input);if(input == ""){alert("You need to fill in the "+form+" section of the form");}}</style>

For the form:

<form ...>.....<input type="text" name="blah" id="name" onblur="IsEntered(name)" />.....</form>

So when people click outside of this it will check, and alert the person if its empty. You might want to use a function to strip the spaces from it to check it. Not sure what function to use to do that though.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...