'request' help

P

polilop

I have a form which shows all Records from a database
eg.
select * from sometable

the user inputs criteria in a form on the sam page and submits it.
i need to see if the form has been submited. and the way to do it is to
see if i have 'Request.form(somefield)' and then refrase the sql into
something like

select *from table where something=this and somethingelse=this
my problem is that i have to check every form field to see if it has been
set(not empty).
Is there a way to see this without checking every form field???
 
B

Bob Lehmann

Is there a way to see this without checking every form field???

Yes, simply apply the same methodology you use to see if there's any beer in
your refrigerator without opening the door.

Bob Lehmann
 
E

Evertjan.

Bob Lehmann wrote on 26 okt 2005 in
microsoft.public.inetserver.asp.general:
Yes, simply apply the same methodology you use to see if there's any
beer in your refrigerator without opening the door.

Look to see if there is a note on the door saying:
"We're out of beer, your're out of luck, be out of here"?
 
M

MyndPhlyp

Evertjan. said:
Bob Lehmann wrote on 26 okt 2005 in
microsoft.public.inetserver.asp.general:


Look to see if there is a note on the door saying:
"We're out of beer, your're out of luck, be out of here"?

No, no, no. That requires effort. It is so much easier to yell from the
comfort of the reclining chair, "Honey, get me a beer."
 
B

Bob Barrows [MVP]

polilop said:
I have a form which shows all Records from a database
eg.
select * from sometable

You should avoid doing this:
http://www.aspfaq.com/show.asp?id=2096
the user inputs criteria in a form on the sam page and submits it.
i need to see if the form has been submited. and the way to do it is
to see if i have 'Request.form(somefield)' and then refrase the sql
into something like

select *from table where something=this and somethingelse=this

Doesn't your table have a primary key??
my problem is that i have to check every form field to see if it has
been set(not empty).
Is there a way to see this without checking every form field???

Sure. Use some client-side code in the form's onsubmit event to populate a
hidden field to indicate whether or not the form's data has been changed.
That will allow you to only check a single field in your server-side code to
see if you need to process the form's data. Of course, you will also need to
fall back to checking all the fields in the event that the client has
client-side scripting disabled.

If you need help writing the client-side code, post to a client-side
scripting newsgroup such as microsoft.public.scripting.jscript.

HTH,
Bob Barrows
 
B

Bob Barrows [MVP]

Evertjan. said:
Bob Lehmann wrote on 26 okt 2005 in
microsoft.public.inetserver.asp.general:


Look to see if there is a note on the door saying:
"We're out of beer, your're out of luck, be out of here"?
:)
Funny, but this is pretty much what i suggested when I suggested that he use
a hidden form field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top