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

passing value from one html to another

P: 1
I have inserted a function to help me pass a value from one html page to a drop down box in another html page. The problem is the code is working only in IE and not in Firefox.

The code in the first page :-

Expand|Select|Wrap|Line Numbers
  1. <a href="reservation.html?rooms=0">Book Now</a>
The code in the 2nd page :-

Expand|Select|Wrap|Line Numbers
  1.   <script type="text/javascript">
  2. function parseState()
  3.         {
  4.               var q = unescape(;
  5.               q = q.substring(7, q.length);
  6.           if (q != "")
  7.           {
  8.             document.getElementById('rooms').options.selectedIndex = q;
  9.           }
  10.         }
  11.     </script>
Sep 25 '08 #1
Share this Question
Share on Google+
1 Reply

P: 93
Hi friend in firefox the query string is not getting parsed correctly.

The code you have written is a bit dependant becoz here you know about url exactly that after 7 characters there is your query but here is the most independant and efficient way of doing the same
Expand|Select|Wrap|Line Numbers
  2. alert(q);//will give you every thing after the query parameter which you can split further for multiple parsing
Sep 25 '08 #2

Post your reply

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