473,498 Members | 1,724 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_array($resumen))
{
echo('<option value="' .$row[id]. '">'
..strtoupper($row[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 1672
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_array($resumen))
{
echo('<option value="' .$row[id]. '">'
.strtoupper($row[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*******@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.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_array($resumen))
{
echo('<option value="' .$row[id]. '">'
and use quotes an an array index when using it in a function.

..strtoupper($row['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
10947
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...
10
1532
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'...
2
1737
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 =...
5
4050
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...
5
4218
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...
2
55216
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....
1
5167
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...
2
3807
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...
9
9904
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...
0
7005
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
7168
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,...
1
6891
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...
0
7381
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
5465
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,...
1
4916
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...
0
4595
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...
0
3096
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...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.