hello evryone.
please someone help me. I want to load the data frm sql server database at the button click...how to load the data using resultset rs.getString("column name") in the <option></option> tag using JSP codes??
anindo87
0
Newbie Poster
Recommended Answers
Jump to Postuse JSP expressions:
<option><%=varName %></option>
or scriptlets:
<option><% out.print(varName); %></option>
expressions are advised
Jump to Postanindo87,
...but i'v tried ths code....it isn't working....
hkansal has wrote an expression for you. Post your source code. Use BB code tags.
Jump to Posthello evryone.
please someone help me. I want to load the data frm sql server database at the button click...how to load the data using resultset rs.getString("column name") in the <option></option> tag using JSP codes??The answer can be found in sticky post of JSP section
Jump to PostHTML tag - </select> must be placed outside the while loop.
show.innerHTML = "<label><select name='select'><% while(rs.next()){%><option><%= rs.getString(1) %></option><option><%= rs.getString(2) %></option><option><%= rs.getString(3).substring(0,10) %></option><%}}catch(Exception ex){out.print("Exception is:- "+ex);}%></select></label>";
All 15 Replies
hkansal
0
Newbie Poster
anindo87
0
Newbie Poster
kvprajapati
1,826
Posting Genius
Team Colleague
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
anindo87
0
Newbie Poster
kvprajapati
1,826
Posting Genius
Team Colleague
anindo87
0
Newbie Poster
kvprajapati
1,826
Posting Genius
Team Colleague
CoSIS1
0
Newbie Poster
anindo87
0
Newbie Poster
anindo87
0
Newbie Poster
kvprajapati
1,826
Posting Genius
Team Colleague
anindo87
0
Newbie Poster
kvprajapati
1,826
Posting Genius
Team Colleague
anindo87
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.