Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Dropped Form Variables

Reply
Thread Tools

Dropped Form Variables

 
 
Kevin Moore
Guest
Posts: n/a
 
      08-13-2004
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
 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      08-13-2004
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session variables dropped using Redirect =?Utf-8?B?UGFycm90?= ASP .Net 2 09-27-2006 10:04 PM
Init Control when dropped on form?? A Traveler ASP .Net 4 10-25-2004 11:50 AM
Dropped session variables tied to SSL pages? Or Redirect? Larry Woods ASP General 5 07-13-2004 03:44 PM
Session Variables Dropped at Random Jason Kichline ASP General 2 09-08-2003 04:54 PM
Unique sequential attribute value in Web User Control when dropped on form in VS.NET James J. Foster ASP .Net 0 08-07-2003 07:05 PM



Advertisments