File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to dispaly the selected value of a dropdown list

 
rammie singh
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi every body...

can you please suggest me how to display the selected value of a drop down list of a page...when we visit that page again.

actually i got some material on net but don't know how to use it.

the link i follwed was

webpage


i will just give you an examlple..


say my drop down list is



now say if i select UK from this.....and i visit this page next time it should show me the "UK" as the selected option

In the link which i followed ..they have used



but i don't know how to use it.

can any body help me.....is there any other way to get the result....what i have been using earlier was puuting all the options in an array...and then comparing the selected value with all the elements ...and whichever matches ..that option was put as selected.
but i want other way...please help .

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply set the attribute selected="selected" on the option that you want.

That code you downloaded looks pretty useless as it uses a lot of proprietary classes that don't exist in the Servlet/JSP environment.
 
Paul Clapham
Sheriff
Pie
Posts: 20206
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:That code you downloaded looks pretty useless as it uses a lot of proprietary classes that don't exist in the Servlet/JSP environment.


Not surprising for a site named "dotnetspider.com", really. Reading a .Net forum for advice about Java programming isn't going to be particularly helpful.
 
rammie singh
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok fine....that's what i have been using...but i want to use the same way what is there on the link.....then how can i use it.....actually in my application there is such an requirement that i want to use the techique give on link page.

the link i reffered
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rammie singh wrote:but i want to use the same way what is there on the link.....then how can i use it.....

Uh, switch to .NET?
 
Riya Apate
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want this in JSP??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Rujuta gl", please check your private messages for an important administrative matter.
 
rammie singh
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yaah i want this in JSp only.....any help??
 
anila honey
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

By using hidden variable,you can handle it.
 
rammie singh
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can we handle it by hidden variable..can you show by a small example please...
and what if there are 7 -8 drop down list on the same page....in that case wil it be a good way to create so many hidden variables.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not see how hidden variables help at all.

Again, all you need to do is to set the selected attribute properly. What's the issue?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic