/    Sign up×
Community /Pin to ProfileBookmark

Textbox and Querystring – Please Help

Hi ALL

This is my first post peeps and need some help. Im tring to pass a some info via a querystring, example:
<a href=”http://www.blah-blah.com/index.asp?myname=amar&function=WEBPAGE&page=4″>AMAR</a>

myname is what i am trying to pass to another page whcih works fine.

But what i am having difficulty with is getting myname to populate a text box in a form on the second page, so the user doesnt have to do it themselves.

Would appreciate some help please.

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JJan 17.2007 — Give this example a try

[B]page1.htm[/B]


[CODE]<a href="page2.htm?myname=amar&function=WEBPAGE&page=4">AMAR</a>[/CODE]

[B]page2.htm[/B]

[CODE]<HTML>
<HEAD>
<TITLE>Document Title</TITLE>

<script type="text/javascript">
<!--

onload=function test(){
if (location.search.length > 0){
dataPassed = unescape(location.search.substring(1))

temp1=dataPassed.split("&")

temp2=temp1[0].split("=")

document.myform.myname.value=temp2[1]

}
}


//-->
</script>


</HEAD>
<BODY>

<form name="myform">
<input type="text" name="myname" value="">
</form>

</BODY>
</HTML>[/CODE]
Copy linkTweet thisAlerts:
@amarnottsauthorJan 17.2007 — Thanks that works - your a star!
×

Success!

Help @amarnotts spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...