wmguk Posted March 17, 2008 Share Posted March 17, 2008 I currently have this script which makes a clickable link on the page for next page etc etc, however I was wondering if i can make a dropdown of pages and this auto change the page? <script type="text/javascript"> for (i=1; i<Math.ceil(galleryarray.length/totalslots)+1; i++) document.write('<a id="navlink'+i+'" href="javascript:jumptopage('+i+')\">Page'+i+'</a> ') document.getElementById("navlink1").className="current" </script> Quote Link to comment https://forums.phpfreaks.com/topic/96514-create-a-dropdown-from-a-script-thats-done/ Share on other sites More sharing options...
Psycho Posted March 18, 2008 Share Posted March 18, 2008 Not tested <script type="text/javascript"> document.write('<select name="page" onchange="jumptopage(this.value);">'); for (i=1; i<Math.ceil(galleryarray.length/totalslots)+1; i++) { document.write('<option value="'+i+'">Page '+i+'</option>'); } document.write('</select>'); </script> Quote Link to comment https://forums.phpfreaks.com/topic/96514-create-a-dropdown-from-a-script-thats-done/#findComment-495032 Share on other sites More sharing options...
wmguk Posted March 19, 2008 Author Share Posted March 19, 2008 excellent thank you, the only issue is I want the drop down box at the top of the page, whereas atm it only works underneath the rest of the code... is there anyway to get this box to the top of the page? Quote Link to comment https://forums.phpfreaks.com/topic/96514-create-a-dropdown-from-a-script-thats-done/#findComment-495667 Share on other sites More sharing options...
Psycho Posted March 19, 2008 Share Posted March 19, 2008 So, put it at the top of the page. Not trying to be an a**, but it should be that simple. Quote Link to comment https://forums.phpfreaks.com/topic/96514-create-a-dropdown-from-a-script-thats-done/#findComment-495844 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.