Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 22nd, 2007, 03:19 PM
Registered User
Join Date: Jan 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Manage ComboBox Selections within JSP


I am new to JSP and im having some difficulty finding out how to show a field in case a value of the combo box is selected. What i need is to show a different field each time a different value is selected in the combobox. How do i do this?

The code:

<logic:equal name="parCombo" value="3">
<html:select styleClass="portlet-form-input-field" property="beneficioCombo" name="vo">

<html:option value="<%= BeneficiosConstants.OPTION_APOSENTADORIA %>"><%= BeneficiosConstants.OPTION_APOSENTADORIA %></html:option>

<logic:notEqual property="beneficioComboNotFull" name="vo" value="true">

<html:option value="<%= BeneficiosConstants.OPTION_BENEFICIO_PROPORCIONAL_ DIFERIDO %>"><%= BeneficiosConstants.OPTION_BENEFICIO_PROPORCIONAL_ DIFERIDO %></html:option>



<logic:equal name="parCombo" value="1">
<%= BeneficiosConstants.OPTION_APOSENTADORIA %>
<logic:equal name="parCombo" value="2">


Reply With Quote
  #2 (permalink)  
Old March 23rd, 2007, 08:01 AM
Friend of Wrox
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post


You can do it in multiple ways,
one you can use javascript and Ajax to get the value selected in the first combo by reading the onchange event and pass the selected value to the server using Ajax and get the list for the second field.
Second you can submit the form when the user changes selection in the first combo using javascript to the same jsp by passing the selected value as parameter and ready request parameter in the jsp to populate the second value.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
programmatically setting selections on a multiSELE rupen Javascript How-To 6 November 20th, 2006 10:14 AM
Two problems regarding selections freddy XSLT 10 November 3rd, 2006 07:52 PM
parameter: 6 selections maximum krema Reporting Services 0 February 20th, 2006 05:07 AM
C# ListBox Working With Multiple Selections pro-logic C# 1 October 9th, 2005 02:15 AM
Select Menu Multiple Selections phungleon HTML Code Clinic 2 July 20th, 2004 12:25 PM

All times are GMT -4. The time now is 04:34 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.