J
Joel
hi,
I have been trying this.
I select an option availabe in select.
and on selecting yes on the confirm msg save and submit it.
Now i select another option and if i select no on the confirm msg
I need to get the previously selected option and use it.I hope u can
help me with this situation
The code is as follows:
<html>
<head>
<script language="JavaScript" >
function joesFunc() {
var x=confirm('Do You want to select this value ?');
if (!x) {
alert('You want to select the previous value which is :
'+document.forms[0].preVal.value)
document.forms[0].myType.value=document.forms[0].preVal.value;
return;
} else {
alert('You have SELECTED:
'+document.forms[0].myType.value)
document.forms[0].preVal.value=document.forms[0].myType.value;
}
document.forms[0].submit();
}
</script>
</head>
<body>
<form name="testjsp">
<select name='myType'> <br>
<option value='0'>Please Select
<option value='1'>One
<option value='2'>Two
<option value='3'>Three
<option value='4'>Four
<option value='5'>Five
</select>
<input type="button" value="Retrieve" onClick="javascript:joesFunc()">
<input type="hidden" name="preVal">
</form >
</body>
</html>
I have been trying this.
I select an option availabe in select.
and on selecting yes on the confirm msg save and submit it.
Now i select another option and if i select no on the confirm msg
I need to get the previously selected option and use it.I hope u can
help me with this situation
The code is as follows:
<html>
<head>
<script language="JavaScript" >
function joesFunc() {
var x=confirm('Do You want to select this value ?');
if (!x) {
alert('You want to select the previous value which is :
'+document.forms[0].preVal.value)
document.forms[0].myType.value=document.forms[0].preVal.value;
return;
} else {
alert('You have SELECTED:
'+document.forms[0].myType.value)
document.forms[0].preVal.value=document.forms[0].myType.value;
}
document.forms[0].submit();
}
</script>
</head>
<body>
<form name="testjsp">
<select name='myType'> <br>
<option value='0'>Please Select
<option value='1'>One
<option value='2'>Two
<option value='3'>Three
<option value='4'>Four
<option value='5'>Five
</select>
<input type="button" value="Retrieve" onClick="javascript:joesFunc()">
<input type="hidden" name="preVal">
</form >
</body>
</html>