Results 1 to 6 of 6
Related
-
Populating Form Field from URL Forum: HTML Forum
Replies: 0 -
Variable in Form action field Forum: Javascript Forum
Replies: 4 -
Pass Form Checkbox Value on Click Forum: Javascript Forum
Replies: 1 -
How to pass an array through a form? Forum: CGI Perl Forum
Replies: 1 -
FROM: field in form Forum: Website Scripts Forum
Replies: 4
-
10-04-2004, 12:36 AM #1
Pass a value from a url string to a form field
How can I pass information such as an afilliate id to a form hidden field when the ID is passed on the URL such as
http://domain.com/formname.html?IDValue
Hidden field name = DEMO1 to receive the value supplied by IDValue from the URL String.
Thanks
Andrewatx
-
10-04-2004, 07:24 AM #2
Okay, I think I'm reading your question right; let me restate your question and my assumptions.
I assume you are using ASP/VB'ish writing... I'd have to do a bit of PHP homework if you're using that (or I'm sure someone can help out there).
You have a variable in your URL:
http://www.url.com/page.asp?var=boogabooga
You want to pull that variable into an ASP variable, such as. The most simplistic way would be to:
HTML Code:Dim strMyVar ' For your variable strMyVar = Request.QueryString("var") response.write(strMyVar) ' To test your variable
If you have multiple vars, you can parse them out by each Request.QueryString("varname").
Good links:
A decent Microsoft TechNet article on keeping persistant information:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q300/5/05.ASP&NoWebContent=1
ASP-Help.com's information:
http://www.asp-help.com/objects/intr53hj.asp
ASP Alliance showing ASP.NET and C#.
http://authors.aspalliance.com/aspxtreme/sys/web/httprequestclassquerystring.aspx
Hope these help!
-David
-
10-05-2004, 03:41 PM #3
not using asp
I'd like to do this with simple html or at most javascript. I need a way without MS tech.
-
10-05-2004, 04:07 PM #4
Here's a sorta messy way to do it with JavaScript.
http://www.htmlgoodies.com/beyond/jspass.html
Basically, drilling down in the previous form with JavaScript to put them in the address bar (might not be needed depending on your coding) and then creating functions to find the position of the text, capture it, and document.write it back. The more I read it... the messier it looks, but it'd get you away from a ASP-based solution.
A good primer for JavaScript cookies can be found at http://www.webreference.com/js/column8/
Second, you could use JavaScript and just set session cookies and have them expire immediately... that'd give you consistancy. To my knowledge, plain HTML is unable to communicate with the actual session variables--it's unaware of anything besides that which it is rendering (e.g. the heirarchy of the objects and classes of the browser and session).
Hope that helps!
-David
-
10-05-2004, 07:12 PM #5
Can you suggest a good Cookie Reference?
This is the first time I have ever played with cookes. Any suggestions for a good reference?
aa
-
10-07-2004, 06:04 AM #6
Yeah, that primer I posted in the previous post is a good place to start--good introduction.
Thanks!
-David