472,958 Members | 2,682 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Identifying user's pick from selection list

I have an application that uses PHP to access a MySQL table and
extract rows which match the user's search entry. Data from the
matching rows are loaded into an HTML selection list, and the user can
scan the list and highlight a selected item.

My question: In PHP, what is the syntax for identifying which row is
highlighted?

My goal is to pass the unique row ID of the selected item to a
subsequent form where all the fields will be displayed for the user to
edit.

I already have the code that loads the selection list and the code
that displays the fields. I just need to know how to determine the
highlighted item.

I have two PHP books, and both discuss loading the selection list, but
there is no mention of what to do next.

Thanks!!
Mark Jones
Jul 17 '05 #1
5 4654
I noticed that Message-ID:
<5e**************************@posting.google.com > from Mark contained
the following:
My goal is to pass the unique row ID of the selected item to a
subsequent form where all the fields will be displayed for the user to
edit.

I already have the code that loads the selection list and the code
that displays the fields. I just need to know how to determine the
highlighted item.


assuming you have your select box set-up like this:

<select name="rowselector">
<option value="rowID">Row description</option>
next option etc..
</select>

The highlighted value will be passed back as the variable
$_POST["rowselector"]

Just do a query with that value in the WHERE clause and populate the
form with the results.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
Thanks, Geoff! That worked. The only thing I'm still wondering about
is the value returned in $_POST["rowselector"] is followed by a
period. I used the trim function to remove the period and the query
worked great. Any idea why the period is there?

Many thanks,
Mark Jones

Geoff Berrow <bl******@ckdog.co.uk> wrote in message news:<0e********************************@4ax.com>. ..
I noticed that Message-ID:
<5e**************************@posting.google.com > from Mark contained
the following:
My goal is to pass the unique row ID of the selected item to a
subsequent form where all the fields will be displayed for the user to
edit.

I already have the code that loads the selection list and the code
that displays the fields. I just need to know how to determine the
highlighted item.


assuming you have your select box set-up like this:

<select name="rowselector">
<option value="rowID">Row description</option>
next option etc..
</select>

The highlighted value will be passed back as the variable
$_POST["rowselector"]

Just do a query with that value in the WHERE clause and populate the
form with the results.

Jul 17 '05 #3
I noticed that Message-ID:
<5e**************************@posting.google.com > from Mark contained
the following:
Thanks, Geoff! That worked. The only thing I'm still wondering about
is the value returned in $_POST["rowselector"] is followed by a
period. I used the trim function to remove the period and the query
worked great. Any idea why the period is there?


None at all. You'd have to post your code.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #4
On Mon, 15 Dec 2003 19:51:19 +0000, Geoff Berrow
<bl******@ckdog.co.uk> brought forth from the murky depths:
I noticed that Message-ID:
<5e**************************@posting.google.co m> from Mark contained
the following:
Thanks, Geoff! That worked. The only thing I'm still wondering about
is the value returned in $_POST["rowselector"] is followed by a
period. I used the trim function to remove the period and the query
worked great. Any idea why the period is there?


None at all. You'd have to post your code.


You really should have known the answer to that one, Geoff.
It was, of course, a female file. <gd&r>
---
- Sarcasm is just one more service we offer. -
http://diversify.com Web Applications
Jul 17 '05 #5
I noticed that Message-ID: <d3********************************@4ax.com>
from Larry Jaques <jake@di\/ersify.com> contained the following:
worked great. Any idea why the period is there?


None at all. You'd have to post your code.


You really should have known the answer to that one, Geoff.
It was, of course, a female file. <gd&r>


And here was me thinking it might just have been the Christmas period.
:-)

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #6

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

Similar topics

1
by: Rob | last post by:
I have 2 drop down menus. 1 is to pick a Province and the other is to pick a trade (plumbng electrical etc) The user selects which province and then what trade then hits submit which should...
0
by: Rick Delorme | last post by:
Hi Everyone, I have 2 problems I am currently investigating. I am hopeful that someone out there can help me out. 1. I have a windows user control in the web browser. This control has a...
5
by: Jim Cobban | last post by:
I am trying to create a web page in which the contents of one selection list depends upon which element in another selection list is chosen, but where the information to populate the first...
5
by: Stephen | last post by:
Could someone please help me with some validation. I have to write code which checks to see whether a dropdown list is populated with a value or a checkbox is checked. I want the code to run on the...
3
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do...
5
by: MLH | last post by:
I have a vehicle entry form with a combo box for choosing the owner. Let's say the user opens the list by clicking the arrow then choose the owner by clicking a name. That much works fine. But...
5
by: Tom P. | last post by:
I am having the following problem: I create a FileSystemWatcher and wait for events. When the event does happen I refresh a FileSystemInfo list and set properties accordingly (IsFile, IsDir,...
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hallo, I have a radiobuttonlist control that is added on a custom Web User Control. This control has a property that exposes the SelectedIndex property of the embedded radiobuttonlist. When...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.