Stephen_Allen Posted September 19, 2006 Share Posted September 19, 2006 Help. I want to set up a form for a website I'm creating, but I'm not sure how to set individual fields to say that they are required, or even if thats possible.Can anybody help Link to comment Share on other sites More sharing options...
aspnetguy Posted September 19, 2006 Share Posted September 19, 2006 You can do this with javascript or server side scripting. Link to comment Share on other sites More sharing options...
Stephen_Allen Posted September 30, 2006 Author Share Posted September 30, 2006 Any idea where I can find the right codes, aspnetguy? Link to comment Share on other sites More sharing options...
aspnetguy Posted September 30, 2006 Share Posted September 30, 2006 with javascript <html><head><title></title><script>function submitForm(){ if(document.myForm.testField.value.length < 1) alert('testfield is required! Put something in it!'); else documment.myForm.submit();}</script></head><body><form action="someotherpage.aspx" method="post" name="myForm"><input type="text" name="testfield"/><br/><input type="button" value="Submit" onclick="submitForm()"/></form></body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now