This is driving me crazy...
I have a URL http://myserver/map.asp?PCode=ABC123" onclick="window.open(this.href);return false;
and want to pass PCode (ABC123) into a text box txtLocation, I can get it in by hardcoding
The snippet of code looks thus:
function requestPosition()
{
document.getElementById("txtLocation").value = 'ABC123';
...
However the parameter will obviously change, I have tried
<% strPostCode = Request.querystring("PCode") %>
then
document.getElementById("txtLocation").value = strPostCode;
and various different options but cannot get the variable to stick, any ideas?
Pass parameter to document.getElementById
-
- 5StarLounger
- Posts: 847
- Joined: 24 Jan 2010, 06:35
- Location: A Magic Forest in Deepest, Darkest, Kent
Pass parameter to document.getElementById
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
-
- 5StarLounger
- Posts: 847
- Joined: 24 Jan 2010, 06:35
- Location: A Magic Forest in Deepest, Darkest, Kent
Re: Pass parameter to document.getElementById
Got it ...stored it as
<%
PC = request.querystring("PCode")
%>
then added value = "<%= PC %>" to an input tag
<%
PC = request.querystring("PCode")
%>
then added value = "<%= PC %>" to an input tag
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it