Chester
09-26-2003, 02:17 PM
I have a form with a drop down list box containing years, (ex. 2003, 2004, etc.) I have a hyperlink that needs to pass the year that the user clicked from the drop down box. How can I do this?
|
||||
Dynamic HyperlinkChester 09-26-2003, 02:17 PM I have a form with a drop down list box containing years, (ex. 2003, 2004, etc.) I have a hyperlink that needs to pass the year that the user clicked from the drop down box. How can I do this? A1ien51 09-26-2003, 02:25 PM <script> function GotoPage(theUrl){ var sel = document.theForm.theDropDown; var txt = sel.options[sel.selectedIndex].text; window.location.href= theUrl + "?theYear=" + txt; } </script> Chester 09-26-2003, 02:48 PM Thanks A1ien51, but how do I call this function? Is it done in the href statement? A1ien51 09-26-2003, 03:19 PM easiest way href="javascript:GotoPage('theurl.htm')" liorean 09-26-2003, 03:21 PM <a href="choseyearmanually.html" onclick="GotoPage('blah');return false;"> Chester 09-26-2003, 03:31 PM Thanks-a-million!!! oracleguy 09-26-2003, 05:30 PM Just make sure you actually make a "chooseyearmanually.html" in case the user doesn't have javascript enabled. |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum