Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Weird problem with VBscript.

Reply
 
Old 04-11-2009   #1 (permalink)
Alexis Faren


 
 

Weird problem with VBscript.

I have this code that I am using after posting a form:

for each key in request.Form
response.write "Choices for: " & session("UseID") & " Value: " & request.Form(Key) & " left " & UCase(left(Key,3)) & "<BR>" (I have this for debugging)

If UCase(left(Key,3)) = "GRP" Then
intCount = intCount + 1

(I do other 'real processing' here, I removed it for brevity)

End if
Next

Essentially it checks to see if the KEY is a radio button group.

This is the output:

Choices for: Robert Value: Andy left GRP
Choices for: Robert Value: Rhonda left GRP
Choices for: Robert Value: Submit Form! left BTN
Choices for: Robert Value: Harry left GRP
Choices for: Robert Value: 25 left TXT
Choices for: Robert Value: Alexis left GRP

Should not be displaying (OR selecting) BTN or TXT. In tct (as far as I know, the Ucase statement should check for this.

I've checked my form (which hasn't change in months) and just can't find the problem.

I can't see the error, hopefully a younger set of eyes can see it.

Thanks Alexis

My System SpecsSystem Spec
Old 04-11-2009   #2 (permalink)
Bob Barrows


 
 

Re: Weird problem with VBscript.

Alexis Faren wrote:
Quote:

> I have this code that I am using after posting a form:
>
> for each key in request.Form
> response.write "Choices for: " & session("UseID") & " Value: " &
> request.Form(Key) & " left " & UCase(left(Key,3)) & "<BR>" (I have
> this for debugging)
>
> If UCase(left(Key,3)) = "GRP" Then
> intCount = intCount + 1
>
> (I do other 'real processing' here, I removed it for brevity)
>
> End if
> Next
>
> Essentially it checks to see if the KEY is a radio button group.
>
> This is the output:
>
> Choices for: Robert Value: Andy left GRP
> Choices for: Robert Value: Rhonda left GRP
> Choices for: Robert Value: Submit Form! left BTN
> Choices for: Robert Value: Harry left GRP
> Choices for: Robert Value: 25 left TXT
> Choices for: Robert Value: Alexis left GRP
>
> Should not be displaying (OR selecting) BTN or TXT.
Why not? You have no code to prevent the data from being written to response
.... All you are doing with the If statement is deciding whether or not to
increment that intCount variable.
You showed the output ... what was the expected output?

A better place for this question might have .inetserver.asp.general


PS. You can remove the name for the submit button to prevent it from being
included in the Request.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
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"


My System SpecsSystem Spec
Old 04-11-2009   #3 (permalink)
Alexis Faren


 
 

Re: Weird problem with VBscript.

Thanks Bob, that's obviously what I missed. I put it where it belongs and
now I get the output I was expecting.

Also, thanks for the tip about the Submit Button.

Alexis

"Bob Barrows" <reb01501@xxxxxx> wrote in message
news:%23wBjfwtuJHA.2248@xxxxxx
Quote:

> Alexis Faren wrote:
Quote:

>> I have this code that I am using after posting a form:
>>
>> for each key in request.Form
>> response.write "Choices for: " & session("UseID") & " Value: " &
>> request.Form(Key) & " left " & UCase(left(Key,3)) & "<BR>" (I have
>> this for debugging)
>>
>> If UCase(left(Key,3)) = "GRP" Then
>> intCount = intCount + 1
>>
>> (I do other 'real processing' here, I removed it for brevity)
>>
>> End if
>> Next
>>
>> Essentially it checks to see if the KEY is a radio button group.
>>
>> This is the output:
>>
>> Choices for: Robert Value: Andy left GRP
>> Choices for: Robert Value: Rhonda left GRP
>> Choices for: Robert Value: Submit Form! left BTN
>> Choices for: Robert Value: Harry left GRP
>> Choices for: Robert Value: 25 left TXT
>> Choices for: Robert Value: Alexis left GRP
>>
>> Should not be displaying (OR selecting) BTN or TXT.
>
> Why not? You have no code to prevent the data from being written to
> response ... All you are doing with the If statement is deciding whether
> or not to increment that intCount variable.
> You showed the output ... what was the expected output?
>
> A better place for this question might have .inetserver.asp.general
>
>
> PS. You can remove the name for the submit button to prevent it from being
> included in the Request.
>
> --
> Microsoft MVP - ASP/ASP.NET - 2004-2007
> 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"
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Weird - Very weird annoying problem General Discussion
weird problem Vista General
weird problem Vista General
weird problem Vista performance & maintenance
Weird Problem Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46