/    Sign up×
Community /Pin to ProfileBookmark

Passing parameters between two HTML pages

Hi,
I want to pass some parameters from one HTML page to another. Can i do it in href attribute of <a> tag. If so, how do i do that and how do i recive the parameters in the recieving page?

Thanks in advance.
-geets

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@geetsauthorJan 20.2003 — Hi,

I tried passing the parameter but at the recieving page, i receive a blank string. I tried 3 ways and following is the code:


<form name="frm" method="post">

<input type="hidden" name="param1" value="val1">

<a href="http://host/directory/Frames.htm" onclick="javascript:fnSubmit()">FramePage</a></p>

</form>

<script language="javascript">

function fnSubmit()

{

frm.submit();

}

</script>

So that the parameter goes as name value pair. But i don't recieve anything at the recieving page.

<form name="frm" method="post">

href="http://host/directory/Frames.htm?param1=val1" onclick="javascript:fnSubmit()">FramePage</a></p>

</form>

<script language="javascript">

function fnSubmit()

{

frm.submit();

}

</script>

Here it doesn't display the page at all.


<form name="frm" method="post">

<a href="http://host/directory/Frames.htm" onclick="javascript:fnSubmit()">FramePage</a></p>

</form>

<script language="javascript">

function fnSubmit()

{

frm.action="http://host/directory/Frames.htm?param1=val1"

frm.submit();

}

</script>

Here, it shows the URL with the parameter and value but shows the page specified in href attribute and so doesn't pass the parameter value.

I capture the values at the secong page using 'location.search.substring(1)'

Could someone pls help.

Thanks.
×

Success!

Help @geets 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.21,
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,
)...