ASP works with VBscript but not with javascript

B

bob

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
 
R

Roland Hall

in message : 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
 
R

Roland Hall

in message : Thanks for replying ... it works

You're welcome. That's good news. (O:=
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top