Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

request.getParameter

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a list box...

country :<select name="country" style="width: 145px;">
<option value="belgium">belgium </option>
<option value="czech republic">czech republic </option>
</select>

when i select belgium, request.getParameter("country")gives me the value "belgium" but when i select czech republic request.getParameter("country") gives me the value "czech"

i am unable to figure it out why this is happening.. Pls. provide some inputs why it could be behaving like this ....which it should not.

Thanks
Neeraj.
 
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the code you posted actually reflect the actual code? I suspect not.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no this is not the actual code.. country names and their values are generated dynamically. these are values which I checked in the the source of the page.

Thanks,
Neeraj.
 
Ranch Hand
Posts: 3851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Neeraj Vij:
Hi,

I have a list box...

country :<select name="country" style="width: 145px;">
<option value="belgium">belgium </option>
<option value="czech republic">czech republic </option>
</select>

when i select belgium, request.getParameter("country")gives me the value "belgium" but when i select czech republic request.getParameter("country") gives me the value "czech"

i am unable to figure it out why this is happening.. Pls. provide some inputs why it could be behaving like this ....which it should not.

Thanks
Neeraj.



What you are expecting???
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Neeraj Vij:
no this is not the actual code.. country names and their values are generated dynamically. these are values which I checked in the the source of the page.

Thanks,
Neeraj.



And...
Did you type it into this page or did you cut and paste it?
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was expecting the value "czech republic". I copied some of the text from the source of the jsp page. Please let me know if I have done something wrong. I will try not repeat that mistake.

Thanks,
Neeraj.
 
Bear Bibeault
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do a View Source from the browser, then cut and paste the HTML of the select element. I suspect you have a quoting issue.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your inputs.will check it and will inform about it asap.
 
reply
    Bookmark Topic Watch Topic
  • New Topic