[thelist] ASP Select Form not auto-selecting

Wade Armstrong wade at wadearmstrong.com
Thu Sep 25 21:06:55 CDT 2003

On 9/25/03 Rob Smith <rob.smith at THERMON.com> wrote:

>Hi list
>If you've ever created a form that submits to itself for form
>before proceeding on, this is for you. Mine has a drop-down menu that, 
>there's something wrong with the form, would auto select whatever WAS
>originally selected:
>response.write request.form("Manager") & " "
>Low and behold my output is:
>92503 92503
>Yet... the test to compare these two to enable the "selected" feature,

The problem is probably with VBScripts loosely-typed nature.

<tip type="ASP/VBScript">
When comparing values in VBScript, always make sure to cast your
variables as the right datatype. Comparing numbers? Try CInt() or
CLng(). Comparing strings? Try CStr(). You never know when VBScript
thinks the number 47 is actually the string "47".

More information about the thelist mailing list