'request' help

Discussion in 'ASP General' started by polilop, Oct 26, 2005.

  1. polilop

    polilop Guest

    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???
     
    polilop, Oct 26, 2005
    #1
    1. Advertising

  2. polilop

    Bob Lehmann Guest

    > 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

    "polilop" <> wrote in message
    news:...
    > 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???
    >
    >
     
    Bob Lehmann, Oct 26, 2005
    #2
    1. Advertising

  3. polilop

    Evertjan. Guest

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

    >> 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.
    >


    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"?

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Oct 26, 2005
    #3
  4. polilop

    MyndPhlyp Guest

    "Evertjan." <> wrote in message
    news:Xns96FB68A63FEA9eejj99@194.109.133.242...
    > Bob Lehmann wrote on 26 okt 2005 in
    > microsoft.public.inetserver.asp.general:
    >
    > >> 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.
    > >

    >
    > 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."
     
    MyndPhlyp, Oct 26, 2005
    #4
  5. polilop wrote:
    > 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
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Oct 26, 2005
    #5
  6. Evertjan. wrote:
    > Bob Lehmann wrote on 26 okt 2005 in
    > microsoft.public.inetserver.asp.general:
    >
    >>> 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.
    >>

    >
    > 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.
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Oct 26, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    0
    Views:
    5,394
    Steve
    Jul 1, 2003
  2. Daniel Bass
    Replies:
    2
    Views:
    3,752
    dave wanta
    Jul 4, 2003
  3. Christian H
    Replies:
    1
    Views:
    898
    Natty Gur
    Jul 29, 2003
  4. Brian Birtle
    Replies:
    2
    Views:
    2,141
    John Saunders
    Oct 16, 2003
  5. Replies:
    0
    Views:
    360
Loading...

Share This Page