The intent is to call an ASP page to perform a series of actions.
I have tried numerous variations with no luck. The concept of submitting a form is clear to me, but calling a specific ASP to perform an action from within a form is not.
Perhaps I am using the wrong approach in this, and may in fact not even need a form, although that will become necessary in the future.
The following produces no errors, but does not display the desired response.
Ideas?
<!-- Main.asp -->
<HTML>
<HEAD>
<BODY bgcolor=black text=red>
<FORM name="Formx" method="post">
<INPUT name = "X" value="See Number 1" type="button" onclick="Validate(1)" action="Response1.asp">
<INPUT name = "Y" value="See Number 2" type="button" onclick="Validate(2)" action="Response2.asp">
</FORM>
<script language="VBScript" type="text/vbscript">
<!--
sub Validate(x)
Set TheForm = Document.forms("Formx"
select case x
case 1
'if validation ok then
TheForm.Submit
'end if
case 2
'if validation ok then
TheForm.Submit
'end if
end select
end sub
//-->
</script>
</body>
</html>
===================
Files to be called:
===================
Response1.asp
-------------
<% response.write("1" %>
Response2.asp
<% response.write("2" %>
I have tried numerous variations with no luck. The concept of submitting a form is clear to me, but calling a specific ASP to perform an action from within a form is not.
Perhaps I am using the wrong approach in this, and may in fact not even need a form, although that will become necessary in the future.
The following produces no errors, but does not display the desired response.
Ideas?
<!-- Main.asp -->
<HTML>
<HEAD>
<BODY bgcolor=black text=red>
<FORM name="Formx" method="post">
<INPUT name = "X" value="See Number 1" type="button" onclick="Validate(1)" action="Response1.asp">
<INPUT name = "Y" value="See Number 2" type="button" onclick="Validate(2)" action="Response2.asp">
</FORM>
<script language="VBScript" type="text/vbscript">
<!--
sub Validate(x)
Set TheForm = Document.forms("Formx"
select case x
case 1
'if validation ok then
TheForm.Submit
'end if
case 2
'if validation ok then
TheForm.Submit
'end if
end select
end sub
//-->
</script>
</body>
</html>
===================
Files to be called:
===================
Response1.asp
-------------
<% response.write("1" %>
Response2.asp
<% response.write("2" %>