-- When you press one of the submit buttons the SetYesNo onclick function starts first & sets the value of the hidden form variable at the bottom (vReviewButton) .
--
_______________ ______________
Is it conveluted - YES - but it was driving me crazy & I found a simple solution (I like simple) that works with javascript
--
Code:
<script LANGUAGE="JavaScript">
function SetYesNo(YN)
{
theForm.vReviewButton.value = YN;
}
</script>
-- Next, the onsubmit function is started (after the button's onclick) to show the value of the button
--
-- After the form's onsubmit is run the action redirects to the next html/asp step
--
<script LANGUAGE="JavaScript">
function Chk()
{
if (theForm.vReviewButton.value == "Yes")
{
alert("You pressed Yes");
}
if (theForm.vReviewButton.value == "No")
{
alert("You pressed No");
}
}
</script>
<form method="post" onsubmit="return Chk(this)" name ="theForm">
<input type="submit" value="Yes" name="vReviewButtonYes"
onclick="SetYesNo('Yes')"/>
<input type="submit" value="No" name="vReviewButtonNo"
onclick="SetYesNo('No')"/>
<input type="hidden" name="vReviewButton" value=""/>
</form>
Is it conveluted - YES - but it was driving me crazy & I found a simple solution (I like simple) that works with javascript
Comment