Jump to content

Recommended Posts

I have a drop down when you click something. It brings up Go to Page, and it has a input and a Go button. What I am trying to do is so when you type in a number, it will go to that page. How the pages load is from ?page=#

 

Here's the code

<script type='text/javascript'>
//<![CDATA[
	/* Templates/Language */
	ipb.templates['page_jump']		= new Template("<div id='#{id}_wrap' class='ipbmenu_content'><h3 class='bar'>Jump to page</h3><form name='form' action='?page=' method='get'><input type='text' class='input_text' id='#{id}_input' size='8' name='page' value='' /> <input type='submit' value='Go' name='submit' class='input_submit add_folder' id='#{id}_submit'/></form></div>");
//]]>
</script>

Link to comment
https://forums.phpfreaks.com/topic/214407-drop-down-go-to-page/
Share on other sites

You don't need to use JavaScript for this. You're actually half way their with the code in that template call; although I don't see anything about a drop-down menu. All you need to do is submit a form with the GET method, and an input with the name of parameter:

 

<form method="get" action="">
    <input type="text" name="page" /> <input type="submit" value="Jump To Page" />
</form>

 

That'll result in a URL like "?page=value of input".

Okay, I have a little button. It uses Javascript, when you click it. It opens a little box under it says Go to Page, with a Text box and a GO button. I am tying to make it so when you click GO and you have a number typed into the box it will go to that page.

I don't think it will. Here's my button and javascript code.

 

<li class='total pagejump clickable pj0252154001'>(3 Pages)
	<img src='http://runelegend.com/public/style_images/deflection/dropdown.png' alt='+' />
	</li>

<script type='text/javascript'>
    //<![CDATA[
        /* Templates/Language */
        ipb.templates['page_jump']        = new Template("<div id='#{id}_wrap' class='ipbmenu_content'><h3 class='bar'>Jump to page</h3><form name='form' action='?page=' method='get'><input type='text' class='input_text' id='#{id}_input' size='8' name='page' value='' /> <input type='submit' value='Go' name='submit' class='input_submit add_folder' id='#{id}_submit'/></form></div>");
    //]]>
    </script>

 

Picture

Unclicked

15rbfc1.png

Clicked

ratimd.jpg

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.