Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Require data in Field

Status
Not open for further replies.

bethabernathy

Programmer
Jul 13, 2001
254
MX
Hi - I am very new to asp. I have a form all set up and the data dumps into an access database. I need to find the code to require users to enter data in one or more fields on the form. I need the following fields to require data:

fromname
fromemail

Is there a simple way to do this?

Thanks, Beth beth@integratedresourcemgmt.com
 
what program are you using to create your pages? some programs (like front page) have it "built in" where it's very simple to do. right click on the text box and see if there's some sort of option for form validation, if so, look for the "required" check box.
hth
mark
 
Hi - I am using Dreamweaver and I can set the fields to be required, but since the fields are named:

fromname

You get a weird message like:

"you must enter fromname"

I want to use asp not the Java that Dreamweaver generates.

Thanks for any and all help. Beth beth@integratedresourcemgmt.com
 
Hi Mark: I guess that site is down. Do you have any other ideas that I can try. beth@integratedresourcemgmt.com
 

bethabernathy,

I use javascript to validate a form.


<body>
<form name=&quot;usrform&quot; method=&quot;post&quot; action=&quot;next.asp&quot;>
<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot; onclick=&quot;return check()&quot;>
</body>

<script language=&quot;javascript&quot;>

function check() {
if (document.userform.name.value.length == 0)
{ alert(&quot;Please input your Name.&quot;);
return false; }
else
return true;
}
</script>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top