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

Making Fields Compulsary

Status
Not open for further replies.

thisismatt

Technical User
Jul 18, 2003
5
GB
I have an ASP form that submits to itself, which searches a DB of archives emails. The results are displayed in a table.

I need to make two date fields mandatory now, preferably by using some VBScript in the ASP, rather than including JavaScript - as some users may have this turned off.

I've searched a few sites for how to do this, but I'm still in the dark then.

Would someone please be willing to guide me through how to do this, as it really confuses me!!

Many thanks
Matt
 
check the two fields for being empty then reshow form or process the form.

Code:
if (request.form("field") = "" or request.form("otherfield") = "") then
' reshow form with filled in fields

else
' process data and display

end if




Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Chris,

Thanks for the reply - unfortunately it doesn't (to me) seem as simple as I'd like!

The page I already have is quite detailed with functions, et al, so I'm not wholly sure about adding in this extra bit.

I'd copy the code I have in here, but I think 440 lines of code is slightly excessive!!
 
thisismatt,
...but I think 440 lines of code is slightly excessive!!
Good for you...you only have that much. One of my ASP files has more than 1500 lines of code, and it's also using the submit-to-itself style. :)
 
I don't suppose anyone's willing to have the code emailed to them and then make the amends, but showing me where they've made them?
 
use this and check the flag at relevant points

Code:
dim frmOK 
if (request.form("field") = "" or request.form("otherfield") = "") then
frmOK = True

else
frmOK = False

end if

conditional includes is the way to go.


Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top