okay
if i had a variable in my the.html
<sciprt language="vbscript">
dim var1
var1 = "blah"
document.Hidden Values.hello.value = var1
</script>
if i want use var1 from "the.html" in my "not.asp"
would be
<input type="hidden" name="hello">
'this declare the variable var1 in my not.asp page?
right?
you will need to submit the hidden fields first then call them in a querystring. There are other ways but this may be the easiest rate now. here is a example you can try.
the.html
<html>
<head>
<script language="vbscript">
sub hidden()
dim var1
var1 = "blah"
form1.hidden1.value = var1
form1.nothidden.value = var1
alert var1
end sub
</script>
</head>
<body onLoad="hidden()">
<form name="form1" method="GET">
<input type="hidden" name="hidden1" value="">
<input type="text" name="nothidden" value="">
<input type=submit value="submit">
<!-- you can submit onunload or some other way, the button
is a example -->
</form>
</body>
</html>
try this and see how it works. I'm sorry if I made a mistake but I'm typing quick got to go. Let me know if you get it.
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
the input is the hidden form field
it is a very common way to pass variables, values to other pages.
the user never sees them.
did you run the code to try it out and see if you understand what I mean?
html or asp really doesn't matter.
it's real easy and straight forward
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
I placed the input="text field there jsut in the example to show the idea of the field being hidden. sorry if that made it confusing
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
hey man, i tested ur code
i didn't make another sub hidden()
i already have an textarea and a button
while i click on button, it will call a sub
in that sub
i put ur code in there
dim saddeg
saddeg =abox.value
form1.hidden1.value = saddeg
abox is my input textarea
but it shows object does not support this function
okay i store the variable in the the.html 's form1.hidden1
fine
but there's seems like to be a promblem to let the asp page read the variable from it
so...
seeing as you are calling it in a asp page try it like this in the second page
<html>
<head>
<%
dim var1
var1 = Request.QueryString("hidden1"
response.write(var1)
%>
</head>
<body>
</body>
</html>
I am sorry, I forgot to tell you you will need the action in the form to specify the page to submit the hidden values like this
<form name="form1" method="GET" action="not.asp">
I checked this on my server to double check and it passed it fine.
hope that does it
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
just wanted to add a bit.
If you save all your pages as .asp pages then you can jsut create a global.asa and have session variables in it for use around the site in all pages without having to do things this way. Far easier that way.
thought!!
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
omg. i even tried the exactly same thing
the second page just can't read from first page
i don't have any problem store the var
first page alert var1 did fine
ff
give me the code. there has to be something else going on here
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
need to see some code to try and figure out what is going wrong
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
first make this ID the same as the name
<input type="text" name="nothidden" value="" ID="Text1">
<input type="text" name="nothidden" value="" ID="nothidden">
then this is asp not javascript
<%
dim ack
ack = request.form1("hidden1"
document.write(ack)
%>
needs to look like this and when using the GET method you need response.querystring not form
<%
dim ack
ack = Request.QueryString("hidden1"
Response.write(ack)
%>
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.