Meidi Novel

Greenhorn
+ Follow
since Dec 13, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Meidi Novel

try this example :
test.jsp
<form name="f">
<select name="testselect" onChange="window.location='test.jsp?val='+document.f.testselect.value">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>

<%
String val= "";
if(request.getParameter("testselect") != null)
val = request.getParameter("testselect");
%>
// check for null before assigning values..good practice.. )

<form name="f2">
<input type="text" value="<%=val%>">
//the value of val will be printed in the text box of the second form
</form>

i hope this will solve ur problem
21 years ago
JSP
The problem i think is, u the page is not loaded with the default value..u are calling the same page on onChange event of the list..

i think this code will be useful
<select name="" onChange="..">
<option value="s">Save</option>
<option value="u">Update</option>
<option value="d">Delete</option>
</select>
.....
//as u know the default value is Save,the remaining program can be written with value="Save"...
String s = "Save";
if(request.getParameter("selectoption") != null)
s = "Save";
// so in the first case, the request.getParameter("selectoption") would be null, then the value of s will be default value ie, "Save"...

i hope this explanation helps u..
21 years ago
JSP