|
Re: how to insert selected dropdown list value in mysql
|
Posted: Aug 21, 2009 1:08 AM
|
|
> hi > i think this can help u > First try to store the result set values in a arraylist. > then in jsp retrieve all the value one by one like this: > > > <tr> > > <td><label class="fieldlabel1">Track Id:</label></td> > <td><label > abel class="fieldlabelLoginErrorMsg">*</label></td> > <td><select name="crtrack" id="crtrack" > class="SelectStyle" > le" onchange="javascript:fnapplication()"> > <% > ArrayList arrTrack = new ArrayList();; > arrTrack = (ArrayList) > ist) session.getAttribute("ARRTRACKID"); > > for (int x = 0; x < arrTrack.size(); x++) { > > String strTrCode = ((SelectionCollectionKeyString) > ring) arrTrack > .get(x)).getStrCode(); > > String strTrValue = ((SelectionCollectionKeyString) > ring) arrTrack > .get(x)).getStrValue(); > > %> > <option value=<%=strTrCode%>><%=strTrValue%></option> > <% > } > %> > </select></td> > </tr> > > > All teh best!
Assuming he is using JSP?
He posted HTML code and asked for assistance, personally I wouldn't use JSPs they are extremely tedios. Secondly, I'd do all looping etc, Server-side (from Java) rather than client-side (JSP).
|
|