I have the following JSP code for a select statement pulling a list of names stored in a database as nameIDs and names. The drop down shows the names (not the ids) Solution 1:
And if you change this:<select id="name" name="name" onchange="updateName(value)">
<option/>
<c:forEach items="${nameForm.nameList}" var="val">
<option ${nameForm.name eq val.nameId?'selected':''}
value="<c:out value="${val.nameId}"/>">
<c:out value="${val.name}"/>
</option>
</c:forEach>
</select>
CopyInto this:<select id="name" name="name" onchange="updateName(value)">
<option/>
<c:forEach items="${nameForm.nameList}" var="val">
<option ${nameForm.name eq val.nameId?'selected':''}
value="<c:out value="${val.name}"/>">
<c:out value="${val.name}"/>
</option>
</c:forEach>
</select>
CopyUpdateHow about something like this: http://jsfiddle.net/robertrozas/y8e4B/
Share
Post a Comment
for "Get Value From Drop Down List In Jsp/jstl When Option And C:out Is Used"
Top Question
Give This Function An Id
We are making a advert div, and we have this function on mo…
Getrowheight() Not Working With Rowmodeltype = 'infinite' With Latest Ag-grid Version
I see this Note on ag-grid site: Changing the row height i…
How To Loop Through Items In A Js Object?
how can I loop through these items? var userCache = {}; use…
Google Maps Api V3 Marker. Google Is Undefined
I've a website with the google maps api which is loaded…
Should I Manipulate Dom Directly Or Using React State/props?
This is the situation: This component renders many data as …
Passing Text_field Value To Will_paginate As Parameter In Rails
I have a controller for Books, in index action I am using w…
Load Different Css Stylesheet With Javascript
I need to use javascript to load a different stylesheet bas…
Set The Custom Properties In Joining Model Using Loopbacks Hasmanythrough
I am trying to set up a many to many relationship in LoopBa…
How To Get Form Data From Pdftron Webviewer
I have a PDFTron webviewer which I use to render a pdf form…
Difference Between For Loop And For-in Loop In Javascript
I found that there is a difference between for loop and for…
Recent Post
Loading...
December 2024
(1)
November 2024
(39)
October 2024
(62)
September 2024
(19)
August 2024
(375)
July 2024
(340)
June 2024
(708)
May 2024
(1300)
April 2024
(812)
March 2024
(1586)
February 2024
(1733)
January 2024
(1387)
December 2023
(1412)
November 2023
(403)
October 2023
(561)
September 2023
(102)
Widget HTML #3
Menu Halaman Statis
Beranda
© 2022 - especialidadeseivconstruccion