|
-
Jun 26th, 2001, 03:55 AM
#1
Thread Starter
Hyperactive Member
Javascript to ASP variable
How can I pass a variable set in Javascript to an ASP style variable?
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Jun 26th, 2001, 05:02 AM
#2
Fanatic Member
Hi parkes
if you mean sending the javascript variable to the same page in the same same hit, you can't as asp is completly server side and can't interact with client side scripting. but if you mean you just want to sen the variable to another asp page you could put it in the query string or in a hidden html field and post it off to the next page.
Hope this helps
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jun 26th, 2001, 05:08 AM
#3
Thread Starter
Hyperactive Member
Thanks that's what I thought and have been trying but for some reason it will not work
Here is the code any ideas?
<%
Response.write "<INPUT TYPE='button' NAME='view' VALUE='V' TITLE='View/Change full details' CLASS='btn2' onClick=""MM_goToURL('parent','companydet.asp?ID=" & Request.Form("companyref") & "&type=view&logid=" & sRef & "');return document.MM_returnValue"">"
%>
It doesn't pass 'companyref' across, though the value is set in the form field and I've even tried Request.Querystring and still no luck.
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Jun 26th, 2001, 06:33 AM
#4
Lively Member
Is the field companyref in the same form as the button? In that case, what you're trying to do is impossible.
Request.Form("companyref") gets the value from the object companyref in the form posted to another page.
Try using Javascript instead (document.myform.companyref.value)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|