Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where did the COMMA come from!

Status
Not open for further replies.

JonathanG6SWJ

Programmer
Jan 18, 2005
39
GB
Hi

I have an asp page with a submit button

<input type="submit" name="btnSelection" value="I made this choice">

On another page I Request.Form("btnSelection") and get the result I made this choice ,

Where / why have I got a space and a comma appended to the end of the text after the word choice?

Thanks in advance
Jonathan
 
If you have more than one form item called btnSelection then when you do a Request.Form("btnSelection") you will get the value of each form item separated by a comma.

Tony
_______________________________________________________________
 
I guess its obvious when you know and quite logical!

Another little gem to remember.

Thanks Tony

 
All,

It seems logical. But, what I do not get is that submit button(s) behaves a bit differently, it seems to me. If you have two submit buttons like this:
[tt]
<input type="submit" name="btnSelection" value="I made this choice">
<input type="submit" name="btnSelection" value="I made that choice">
[/tt]
However reasonable or unreasonable, the request.form("btnSelection") would get either "I made this choice" or "I made that choice" depending on which button is chosen. But _not_ "I made this choice,I made that choice", which would otherwise be if it involves other controls like textbox say. So I don't get what is the problem.

- tsuji
 
The other form item called btnSelection might not be a button (despite the name) I have had occurences like this when I have cut and pasted code and forgotten to change the form item names.


Tony
_______________________________________________________________
 
FesterSXS,

Okay, submit button plus something else! That may be it. Thanks.

regards - tsuji
 
buttons will only take on the value when clicked, otherwise will be returned as a named item in the form collection as an empty string.

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top