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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one asp file to accept data from many forms?

Status
Not open for further replies.

hecktic

Programmer
May 14, 2002
84
CA
Hi,

I'm trying to figure out something and need some help.

I have a site with several forms. On these forms, some text fields may or may not be empty.

Now, i want to use an asp file what will accept any form that is submitted to it and enter the information into a database (different tables). The problem is that the form is only sending the text fields that are filled.

Example:

Form1.asp has text1, text2, text3; action="getData.asp" & POST; and only text1 and text3 contain data

getData.asp gets what's in text1 and text3. How do i insert a null instead of text2? It's non existant in getData.asp,
and doing a regular insert statement will put text3 in the spot of texts in the db table.

I hope someone can understand what i mean :)
and can help.

Thanks!
 
If Request.Form("text2")="" then
stext2=Null
Else
stext2="'"&Trim(Request.Form("text2"))&"'"
End if

Then use stext2 in your insert query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top