Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

html select change to make JSP page forward keeping the exsting field value

843836Jun 20 2005 — edited Aug 21 2005
Hello, All,
I am trying to make the change of a selection box in HTML form to reload the page and populate the second selection box based on the value in the first selection box. The content of the second selection box is from database....

i used a javascript funtion and called it by the onChange(), the onChange redirect the page to the same page. However all my previous input is lost and the second selection box is not populated based on the first selection box.

The question is how do I keep the current input and reload the page based on the change of a selection box?
Please help..

Thanks..

Here is the code

<script language=javascript type="text/javascript">
function forward(){
location.href="trdCapDetail.jsp";
}

</script>

<select name=vehicle onChange="forward()">
<%for(int i = 0; i < Vehicle.getAll().size(); i++){

Vehicle vehicle = (Vehicle)(Vehicle.getAll().elementAt(i));
out.write("<option value=" + vehicle.getKey()+" >" + vehicle.getCode() + "</option>");
}
%>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2005
Added on Jun 20 2005
4 comments
707 views