Dropped Form Variables

Discussion in 'ASP General' started by Kevin Moore, Aug 13, 2004.

  1. Kevin Moore

    Kevin Moore Guest

    Hello. I have an ASP page written in JSCRIPT that contains a regular
    text field for a start date and an end date. The user may enter values
    in this field or not. If the user doesn't enter any values, the
    onclick event of the submit button populates these fields with a hard
    coded default start and end date. I know this works because I can
    actually see them populate before the page actually submits.

    These two values are requested on the next page and everything works
    like a champ for me. The problem is that my client ocassionally gets
    "undefined" for these two values. Since they're used in a SQL
    statement on the page, the script bombs. I can't for the life of me
    figure out how these two values are being dropped! There's no interim
    redirect page and nothing that I know of that would cause them not to
    exist. The only possible theory I have is that the client is using a
    proxy server (I don't know which) and I've had session variable
    trouble with them in the past. But since this is a basically
    straightforward HTML form variable problem, I don't have a clue. Any
    help would be appreciated.

    Kevin
    Kevin Moore, Aug 13, 2004
    #1
    1. Advertising

  2. Kevin Moore wrote:
    > Hello. I have an ASP page written in JSCRIPT that contains a regular
    > text field for a start date and an end date. The user may enter values
    > in this field or not. If the user doesn't enter any values, the
    > onclick event of the submit button populates these fields with a hard
    > coded default start and end date. I know this works because I can
    > actually see them populate before the page actually submits.
    >
    > These two values are requested on the next page and everything works
    > like a champ for me. The problem is that my client ocassionally gets
    > "undefined" for these two values...


    Rather than depending on client scripting for your data integrity, why not
    simply use conditional assignment on the server. After all, JScript makes it
    easy:

    var StartDate = Request.Form("StartDate").Item || "2004-01-01"

    No client scripting required with this approach. Of course, I'd still do
    some validation on any value I was intending to hand off to the DB...



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Aug 13, 2004
    #2
    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. James J. Foster
    Replies:
    0
    Views:
    526
    James J. Foster
    Aug 7, 2003
  2. A Traveler

    Init Control when dropped on form??

    A Traveler, Oct 23, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    535
    WALDO
    Oct 25, 2004
  3. =?Utf-8?B?UGFycm90?=

    Session variables dropped using Redirect

    =?Utf-8?B?UGFycm90?=, Sep 27, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    472
    =?Utf-8?B?UGFycm90?=
    Sep 27, 2006
  4. Jason Kichline

    Session Variables Dropped at Random

    Jason Kichline, Sep 6, 2003, in forum: ASP General
    Replies:
    2
    Views:
    107
    HarryD
    Sep 8, 2003
  5. Larry Woods
    Replies:
    5
    Views:
    370
    Mark Schupp
    Jul 13, 2004
Loading...

Share This Page