Hi,
I'm trying to submit a form when I click on an image, and set a variable within that form to a specific value, depending on which image was clicked on. How can I set that variable in client-side script? (JavaScript or VBScript is fine). Here's some of the page's code below. With this code I get an error on the line where I try and set the value saying:
Error: 'document.MyForm.vari' is null or not an object
<head>
<script language="JavaScript"
function CheckValues(cond, value) {
...
if (cond == "end" {
document.MyForm.vari.value = value;
document.MyForm.Submit();
}
// 3 other if conditions (not really necessary, but how I was doing it at first...)
}
</script>
<body>
<form ACTION="DailyJumboForm.asp" METHOD="POST" name="MyForm">
...
<input type="hidden" name="vari" value="<%=strVari%>">
<input type="image" src="../../../images/btnForwardArrowLine.gif" onClick="Javascript:Arrows('end', 'endValue');">
3 other images
...
</form>
Thanks,
Ray
I'm trying to submit a form when I click on an image, and set a variable within that form to a specific value, depending on which image was clicked on. How can I set that variable in client-side script? (JavaScript or VBScript is fine). Here's some of the page's code below. With this code I get an error on the line where I try and set the value saying:
Error: 'document.MyForm.vari' is null or not an object
<head>
<script language="JavaScript"
function CheckValues(cond, value) {
...
if (cond == "end" {
document.MyForm.vari.value = value;
document.MyForm.Submit();
}
// 3 other if conditions (not really necessary, but how I was doing it at first...)
}
</script>
<body>
<form ACTION="DailyJumboForm.asp" METHOD="POST" name="MyForm">
...
<input type="hidden" name="vari" value="<%=strVari%>">
<input type="image" src="../../../images/btnForwardArrowLine.gif" onClick="Javascript:Arrows('end', 'endValue');">
3 other images
...
</form>
Thanks,
Ray