473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Text field requesting page number to go to

I have an index page for an online mag that I'd like to include a text field with "Go to page" text field, and a Go button. I would like the user to be able to type in the page number they want to go to and when submitted it gathers that information and goes to the correct page.

I have been searching for this for days. I must not be searching on the right words because I'm just not finding the answer. Any help would be grately appreciated!!!

Thanks,
GG
Mar 1 '07 #1
5 1745
drhowarddrfine
7,435 Expert 4TB
This can't be done with html or css. You need a programming language, in this case, javascript. I will move this to that board so you can get help there.
Mar 1 '07 #2
AricC
1,892 Expert 1GB
I have an index page for an online mag that I'd like to include a text field with "Go to page" text field, and a Go button. I would like the user to be able to type in the page number they want to go to and when submitted it gathers that information and goes to the correct page.

I have been searching for this for days. I must not be searching on the right words because I'm just not finding the answer. Any help would be grately appreciated!!!

Thanks,
GG
A few things, do you want them to type page numbers? I'm not really sure how that would work unless your pages are titled 1.htm 3.htm etc... If your looking for a site search you may need to use server side scripting. Lastly, are you trying to do this with HTML only? I think at least you need javascript.
Mar 1 '07 #3
thank you drhowarddrfine for moving my post to the javascript discussion board. I thought that was where it needed to be but couldn't find anything pertaining to that when searching javascript for this topic.

The pages are named page1.html, page2.html, etc. I can name them whatever will help make this work. There is a mysql database set up for backend admin so I could use a server side script. What would work?

Thanks very much!
Mar 1 '07 #4
acoder
16,027 Expert Mod 8TB
You can do this without server-side code by taking the form value and changing the location. Are you sure everyone will have javascript turned on? If not, you should use a server script or provide links to the other pages.

Anyway, with javascript, use the button onclick event handler to call a function which gets the text input value. Once you have this value, parse it to make sure it's an integer. If it's between 1 and the last page number, just relocate the browser to the new page:
Expand|Select|Wrap|Line Numbers
  1. location.href="page"+num+".html";
where num is your parsed number from the input box.
Mar 1 '07 #5
thanks everyone for your help!
Mar 1 '07 #6

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

Similar topics

1
by: dmiller23462 | last post by:
Hi again guys.... This is my first source of help, by far the best ASP intellectual collective....Thanks in advance for any assistance...Anyway.... The forms I'm still working on (finishing...
1
by: PC User | last post by:
I found this Rich Text Editor and I've been trying to recreate it in my own application. I've had trouble with the COMCTL.ImageListCtrl and the COMCTL.Toolbar to recreate the toolbar. And I've...
5
by: Cro | last post by:
Hello Access Developers, I'd like to know if it is possible to perform a count in an expression that defines a control source. My report is based on a query. In my report, I want a text box to...
3
by: Alexander | last post by:
Hi all I has Component inside ASP.NET page that create CO object and store reference to it in the Component's privat static field. Then I cast this reference to desired interfac and call...
6
by: Lelle | last post by:
Hello ! how can i insert text containg code examples from a textbox into a database using SQL insert statment. i have no problem to just add text that dont contains code and script examples...
3
by: kvnsmnsn | last post by:
I've written the following Javascript file that includes an input text field and an output text field, the latter of which is initialized to zero. Each time the user enters a number in the input...
1
by: plumba | last post by:
Hi all. I have a form which has a table and within the rows of the table are simple text input boxes. The ONLY problems with this is that when the form is posted (in text format) if the number of...
11
by: Mike Harrison | last post by:
Hi, I have some simple HTML like this: <div id="container" style="width:100%;"> <input type="text" <input type="button" style="float:right;" value="Click here..."> </div> I want the button...
8
tharden3
by: tharden3 | last post by:
Hey Bytes, The website I'm working on is coming along just fine, and I'd like to thank all of you PHP folks who have been helping me out. I'm almost done with the coding! I'm trying to get the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.