| Author |
ASP works with VBscript but not with javascript
|
|
|
| Hi,
I made a ASP file in order to pass variables from VB or JAVAscript to the
ASP-server. Both ASP script are in VB, but the client-script are in VB and
in JAVAscript. The name are testvb.asp and testjava.asp.
My problem is: it works with testvb.asp but not with testjava.asp (no error
but nothing appears)
1) testvb.asp:
<form name="fo" method="post">
<SELECT name="pck" STYLE="position:absolute;left=140;width:45">
<option value=1> 1
<option value=2> 2
</SELECT>
<input name="hid" type="hidden" value="" >
<INPUT id=go TYPE="button" value="test"
STYLE="Position:absolute;left:280;top:200">
</form>
<script language=vbscript>
sub go_onclick()
on error resume next
fo.hid.value="bobo"
fo.action="testvb.asp"
fo.submit
end sub
</script>
<%
a=request("pck")
b=request("hid")
response.write(a & " " & b)
%>
1) testjava.asp
<form name="fo" method="post">
<SELECT name="pck" STYLE="position:absolute;left=140;width:45">
<option value=1> 1
<option value=2> 2
</SELECT>
<input name="hid" type="hidden" value="" >
<INPUT id="go" TYPE="button" value="test"
STYLE="Position:absolute;left:280;top:200">
</form>
<script language=javascript>
function goonclick()
{
document.getElementById("hid").value="bibi"
document.getElementById("fo").action="testjava.asp"
document.getElementById("fo").submit
}
document.getElementById("go").onclick=goonclick
</script>
<%
a=request("pck")
b=request("hid")
response.write(a & " " & b)
%>
By the way, suppose i want also the asp-script in javascrip: is the code
between <% %> also valid for javascript?
Thanks for any help
bob
| |
| Roland Hall 2004-05-30, 11:54 am |
| "bob" wrote in message news:%233acySWREHA.3944@TK2MSFTNGP11.phx.gbl...
: My problem is: it works with testvb.asp but not with testjava.asp (no
error
: but nothing appears)
:
: 1) testjava.asp
: <form name="fo" method="post">
<form name="fo" method="post" onsubmit="return goonclick()">
: <SELECT name="pck" STYLE="position:absolute;left=140;width:45">
: <option value=1> 1
: <option value=2> 2
: </SELECT>
: <input name="hid" type="hidden" value="" >
: <INPUT id="go" TYPE="button" value="test"
STYLE="Position:absolute;left:280;top:200">
<input id="go" type="submit" value="test" style="position: absolute; left:
280px; top: 200px" />
: </form>
:
: <script language=javascript>
<script type="text/javascript">
: function goonclick()
: {
: document.getElementById("hid").value="bibi"
: document.getElementById("fo").action="testjava.asp"
: document.getElementById("fo").submit
// document.getElementById("fo").submit
return true;
: }
: document.getElementById("go").onclick=goonclick
// document.getElementById("go").onclick=goonclick
: </script>
:
: <%
: a=request("pck")
: b=request("hid")
: response.write(a & " " & b)
: %>
:
: By the way, suppose i want also the asp-script in javascrip: is the code
: between <% %> also valid for javascript?
<%@ Language="JScript" %>
or
<%@ Language="Javascript" %>
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
| |
|
| Thanks for replying ... it works
| |
| Roland Hall 2004-05-30, 11:54 am |
| "bob" wrote in message news:ugsahwWREHA.3988@tk2msftngp13.phx.gbl...
: Thanks for replying ... it works
You're welcome. That's good news. (O:=
|
|
|
|