thanks for the quick response.. but I'm using jsp.. :D
Main Topics
Browse All TopicsHi,
I would like to ask about the onchange method in javascript.
For example: if there is name combobox in my jsp page, the names inside it are retrieved from database. if I want like if I select 'lala' from combobox then it will display a table of information about 'lala' such as her address and contact no but if I never select anything then it doesn't show the table.
I've manage to find out how to do that by reloading to that page and passing the parameter name so the url is something like this: http://192.168.28.174:8080
if its empty then it will be like this:
http://192.168.28.174:8080
which I don't want... I want it to be like this:
http://192.168.28.174:8080
cos there are a lot of pages that is linked to this page so if I change that it will become more complicated. any ideas how to do that? thanks.
here is my sample code:
<select name="samplecode" size="1" id="select" onchange="location.reload(
<option selected><%= request.getParameter("samp
<option></option>
<%
conn = db.getConnection();
stmt = conn.createStatement();
sql="select sample from sampledefinition";
rs=stmt.executeQuery(sql);
while(rs.next()){
%>
<option value="<%=rs.getString("sa
<%}
rs.close();
stmt.close();
conn.close();
%>
</select>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Oh sorry, but it will work basically the same way, on your JSP page, use the method to request values from the URL querystring.
<form name="form1" method="get" action="">
<select name="select" onChange="form1.submit()">
<option>Value1</option>
<option>Value2</option>
<option>Value3</option>
</select>
</form>
Business Accounts
Answer for Membership
by: minichickenPosted on 2004-10-29 at 02:46:40ID: 12442608
You can do somoething like this: A form which will submit to it self. and on your ASP page you just use Request.Querystring to get the value.
<form name="form1" method="get" action="">
<select name="select" onChange="form1.submit()">
<option>Value1</option>
<option>Value2</option>
<option>Value3</option>
</select>
</form>