This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
    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:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

list values

 
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have a drop down list like below

<select
<option> name = quater value= 1
Q1<option>
<select>

In the servlet or other jsp , If I want the Q1 not the values of Q1, How would I achieve this.

suppose like this
String quater = request.getParmatername();



thanks a lot
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
one way is to store the option's text to a hidden component and take the value of the hidden from the request.
NOTE: onchange in combo(option) event, in javascript, assign the text to the hidden component.
 
Ranch Hand
Posts: 72
Scala Monad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Check out

Class ServletRequest
Method: public java.util.Enumeration getParameterNames()
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
The simplest and easiest is to place the Q1 as a value as well.
Is there any problem with that?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator


This is not a valid option tag or select tag.
Did you cut and paste this into Javaranch or did you type it yourself?
If the latter, please make sure that there are no typos in this code.
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Here is the code


I want to get the Q1,Q2,Q3 and Q4 not the values. What is the best way to do it?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
They're still malformed.
What does getSelection(1) return?
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
here is the code for getSelection()
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
So, it returns "SELECTED" or an empty string.

Browsers do not send the text of a select box option to the server, so you'll need to either map the values on the server or use Javascript to read the text for the given option and add it to the form submission. (as krishna mentioned)
 
Sheriff
Posts: 67735
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:
  • Report post to moderator
So why are you making the important dats not the value? Why do things the hard way? As said previously, make the value what you want returned. Simple.
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Is it possible to display web page in a table to show
row vertically and column horizontally

I want to show some thing like this

aaaa 1 2 3 43 4 4 4 4 4 4
bbbb 0 2 3 4 4 5 5 5 5 5 5
eeee 2 3 3 3 3 3 3 3 3 3
dddd 2 2 2 2 2 2 2 2 2 2 2

How would I write the code in all columns horizonatlly
and row vertically
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This sounds like a completely different question.
It would be better it you started a new thread with it.
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic