473,606 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Next value

Hi!!!

I've made a form with a 'select' statement through a

echo('<select name="res">');
echo('<option selected value=""> Select option</option>");');
while($row = mysql_fetch_arr ay($resumen))
{
echo('<option value="' .$row[id]. '">'
..strtoupper($r ow[titulo_esp]). '</option>');
}
echo('</select>');

The user selects an option and a text is displayed. Now, I want to
insert a "previous" and a "next" button so the user can navigate from
here without selecting any other value from the "select" form.

Example: The posible 'id' values are: 1,4,5,7,8,9. The user chooses 5,
so if he press the "next" button he will navigate to the page with the
id#7 and if the user selects "previous" he will go to the id#4.

I tried to use the funtion next(), but I don't know how to do it.

Can anyone help me with this problem?

Thanks in advance!

Ezequiel

Jan 31 '06 #1
2 1681
zek2005 wrote:
Hi!!!

I've made a form with a 'select' statement through a

echo('<select name="res">');
echo('<option selected value=""> Select option</option>");');
while($row = mysql_fetch_arr ay($resumen))
{
echo('<option value="' .$row[id]. '">'
.strtoupper($ro w[titulo_esp]). '</option>');
}
echo('</select>');

The user selects an option and a text is displayed. Now, I want to
insert a "previous" and a "next" button so the user can navigate from
here without selecting any other value from the "select" form.

Example: The posible 'id' values are: 1,4,5,7,8,9. The user chooses 5,
so if he press the "next" button he will navigate to the page with the
id#7 and if the user selects "previous" he will go to the id#4.

I tried to use the funtion next(), but I don't know how to do it.

Can anyone help me with this problem?

Thanks in advance!

Ezequiel

You should really do this with JavaScript. PHP could do it, but it
would be really slow.

next() is for arrays only, which advances the array internal pointer.

To go about this using javascript:
- Give each element an sequential ID.
- On the press of next, select current id + 1 (using dom).

--
Carl Vondrick
us****@carlsoft .net
www.carlsoft.net
Jan 31 '06 #2

"zek2005" <es*******@gmai l.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hi!!!

I've made a form with a 'select' statement through a

echo('<select name="res">');
echo('<option selected value=""> Select option</option>");');
you should fix this. spurious characters between options will cause wierd
things to happen in some browsers.

echo('<option selected value=""> Select option</option>');

while($row = mysql_fetch_arr ay($resumen))
{
echo('<option value="' .$row[id]. '">'
and use quotes an an array index when using it in a function.

..strtoupper($r ow['titulo_esp']). '</option>');
}
echo('</select>');

The user selects an option and a text is displayed. Now, I want to
insert a "previous" and a "next" button so the user can navigate from
here without selecting any other value from the "select" form.

Example: The posible 'id' values are: 1,4,5,7,8,9. The user chooses 5,
so if he press the "next" button he will navigate to the page with the
id#7 and if the user selects "previous" he will go to the id#4.

I tried to use the funtion next(), but I don't know how to do it.

Can anyone help me with this problem?

Thanks in advance!

Ezequiel

Feb 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
10958
by: george | last post by:
Can anyone help? I query a database and return a result on the column "reference". There might be 7 listings. Each row is displayed in a table, with links through to a detail page. I am working on having a "previous" record and a "next" record link on the detail page. This code below works, for the "next" record, by searching the values in the array $myarray for the variable $ref. It then returns the key value and the key value, as a...
10
1547
by: wk6pack | last post by:
Hi, I have a form with the following elements: first form <input type='text' name='addr1' value='1223 westward'> <input type='text' name='addr2' value='12 admirals rd'> <input type='text' name='addr3' value='90 Northward'> <input type='text' name='addr4' value='apt 12 34 Marine way'> <input type='text' name='addr5' value='2nd floor 900 Main St'>
2
1752
by: Deniz Bahar | last post by:
Hi, I'm working with a single linked list and want to delete elements by searching through the list (starting form the HEAD) then finding the element, then doing the following: NewElement = CurrentElement->next; CurrentElement->next = NewElement->next->next; free(NewElement);
5
4063
by: robecflo | last post by:
Hi Forum, i have a problem, hope somebody can give me ideas. I'm developing with windows forms and vb.net, and oracle as a database. At this moment i have a table called amortizaciones, this table has a field called id_pasivo, which is foreign key to another table called pasivo, a consecutive field called no_cupon and a third field called date. So when i make a query (i.e select * from amortizaciones where id_pasivo = 522 order by...
5
4225
by: Simon | last post by:
Hi all, I am writing a windows application using vb.net on the 1.1 framework. We have in the application, some strongly typed collections that have been written as classes that do not inherit from collection base, but use an internal collection, to hold the objects and then implement IEnumerator, see example below,
2
55288
by: yawnmoth | last post by:
Say I have two input elements and that I wanted to make it so that when the first ones input was what it should be, the focus would automatically be shifted to the next input element. ie. something like... <input onkeyup="if (this.value.length == this.maxlength) document.forms.elements.focus()" value="whatever" maxvalue="x" type="text" /> <input value="whatever" maxvalue="x" type="text" />
1
5182
by: ssims | last post by:
I've got this code for a random GDI+ chart generator, and the demo works, but when I try to run it on my local machine I get a compiler error: Compiler Error Message: CS0117: 'Random' does not contain a definition for 'Next' Here's the code: using System; using System.Collections; using System.ComponentModel; using System.Data;
2
3818
by: =?Utf-8?B?aGVyYmVydA==?= | last post by:
how do I code generic functions to return the next item in an enumeration a) sorted by name, b) sorted by value c) sorted by declaration in a round-robin style ? for example the enum is Enum Colors Red = 5 Green = 7 Blue = 16 Yellow = 2
9
9909
by: ajos | last post by:
Hello friends, After thinking about this for sometime, i decided to post this in the java forum. Well my problem here in detail is, i have 3 jsp pages where in a.jsp(for example) i have a combo box, based on the selection of the value in that combo box, b.jsp page gets populated with the value associated to a.jsp, and again based on the selection of value of the 2nd combobox my 3rd combo box gets populated, which is in c.jsp. I'm able to...
0
8010
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7942
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8429
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8084
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6761
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5461
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3922
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1550
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.