Forum Moderators: open
Basically the user selects the failover button from the form, it calls the failover function that kicks off a confirm and populates var accordingly then the getParameter call gets the CNFRM val and acts accordingly. The client always gets 'false' for the value. We cannot reproduce this behavior.
We see the correct value of CNFRM in the http string window in the browser.request. It seems getParameter is not getting the value.
I am new to javascript and the people that wrote this are no longer here. I was hoping someone could see something incorrect or unstable in this logic.
Thanks
....function.....
<script type="text/javascript">
<!--
function Failover()
{
if( confirm('Are you sure you want to failover?') == true)
{
document.myForm.CNFRM.value = "true";
return true;
}
else
return false;
}
-->
</script>
....form.....
<table width="750" cellpadding="0" cellspacing="0" border="0">
<tr>
<form name="myForm" action="thisFile.jsp">
<td> <input type="submit" name="SUB2" value="<%= pt2 %>" class="yellowbutton" onclick="Failover()"></input></td>
<input type="hidden" name="CNFRM" value="false"></input>
</form>
</tr>
</table>
....after submission.....
<%
String cnfrm = request.getParameter("CNFRM");
if(cnfrm.equals("true"))
{
...do stuff...
}
%>
function Failover(){
if( confirm('Are you sure you want to failover?') == true){
document.myForm.CNFRM.value = "true";
document.myForm.submit();
}
else return false;
}
<td> <input type="button" name="SUB2" value="<%= pt2 %>" class="yellowbutton" onclick="Failover()"></input></td>