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

Empy Form Fields 1

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
Hello fellas...
Can someone point me in the right direction on how to verify that only some fields here are not left blank?.
For this example I only need accnumber and taxid not to be left blank. Any help would be appreciated.


SQL="INSERT INTO vendors (accnumber,company,address1,address2,city,state,zip,paymentdate,terms,vendor1099,taxid) Values ("&_
"'"& request.form("accnumber")& "', " &_
"'"& request.form("company")& "', " &_
"'"& request.form("address1")& "', " &_
"'"& request.form("address2")& "', " &_
"'"& request.form("city")& "', " &_
"'"& request.form("state")& "', " &_
"'"& request.form("zip")& "', " &_
"'"& request.form("paymentdate")& "', " &_
"'"& request.form("terms")& "', " &_
"'"& request.form("vendor1099")& "', " &_
"'"& request.form("taxid")& "')"

Dim RSvendors
set RSvendors=server.createobject("adodb.recordset")
RSvendors.open sql, "dsn=db1"
%>






QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
if request(&quot;accnumber&quot;) = &quot;&quot; then
'do something here to fill it in or send the user back to the form
end if

That's how you can test if its null or not...


Thanks!
Erica
 
Cool. Thanks Erica QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
Just one more Questions Erica
Where on my page is best to append the code?

if request(&quot;accnumber&quot;) = &quot;&quot; then
'do something here to fill it in or send the user back to the form
end if
Above my SQL?
After each request.form(&quot;&quot;) field ?
before my HTML ?


QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
Definitly above your sql. You don't want your application to enter this info to the database if its not complete. You should do it on the page containing the sql though. If your gonna send them back to the page to complete the form, you should response.redirect them to a page which tells them their error. Then they should get a link which takes them back to the form to complete and resubmit it. (That's just how I would do it though...)

HTH,
Erica Erica
 

Thanks again Erica. It worked great! :) QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top