Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Form Validation

Form Validation

Form Validation

I know this is rather elementary for the bulk of you, but its not soaking into my brain.

I have a form with a field that the person has an option to fill out or not. I want to pass the value they input and if they don't input something I want to be able to assign a value to pass.

Something like if the variable is empty then assign the word "Anonymous" and pass that value, otherwise pass.

For example

If variable name "name" is not filled out by the user then
assign "Anonymous" to the variable name,
else if the variable name "name" was filled out by the user then pass that.

I have to do this kind of programming once every 10 years, so its certainly not second nature to me. Thank you for any resources you can suggest.

RE: Form Validation

What code do you already have?

RE: Form Validation

If Request.form ("email") = " " Then
Request.form ("email") = "webmail@xxxxxxxx.org"
Else useremail = Request.Form ("email")
End If

RE: Form Validation

How about this:


useremail = Request.Form("email")
If useremail = "" Then useremail = "webmail@xxxxxxxx.org" 

Also, since this appears to be Classic ASP, you may be better off posting in forum333: Microsoft: ASP (Active Server Pages).

RE: Form Validation

Thank you! I will try the other forum. It didn't work.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close