By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,945 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,945 IT Pros & Developers. It's quick & easy.

passing value to a html from another html

P: 4
hi
i have two html aa.html and bb.html.
there is a combo box in aa.html.

i have to pass the selected combo box value to bb.html.
and recieve that value in bb.html.

what i have already tried is listed below:
aa.html:

<html>
<script language="JavaScript">
function button_press()
{
document.test.action="bb.html";
document.test.submit();
document.write("<h1>"+document.all.drop1.value+"</h1>");
}
</script>
<body>

<form name=test method=post>

<select name=drop1>
<option value=a>debu</option>
<option value=b>asim</option>
<option value=c>san</option>
<option value=d>pari</option>
</select>
<input type=submit name=submit value=submit onclick=button_press()>
</form>
</body>
</html>
plz help........
Jun 14 '07 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
You can't use document.write after the page has loaded and in any case, it wouldn't work.

Use the GET method and the combo box value should be in the url. Then use the location.search property and parse the url for the value in bb.html.
Jun 14 '07 #2

P: 4
akb
thanks a lot..

using window.location.href i have got..
Jun 14 '07 #3

acoder
Expert Mod 15k+
P: 16,027
No problem. You're welcome.
Jun 14 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.