473,385 Members | 1,588 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,385 software developers and data experts.

how to create list of people with Yes/No radio buttons for each, then process form

I have a database result set with names, IDfield and a Y/N field.

How do I create the radio buttons that can then be processed easily using an
array (I assume) with an easy-to-loop-through structure?

The form would look like:

Joe Smith O[Y] O[N]
Karen Smith O[Y] O[N]
....

Any ideas are appreciated!
Dec 19 '05 #1
2 1979
That's more code than I want to write here also your form structure
would probably differ from mine, but I can say you got the general idea
there. Here is a general idea of how the code goes:

General structure would be
read in the data...
- set counter to 0
- select the records
- loop through the record with mysql_fetch_array
- - increment counter
- - Read in record ID, Name and Yes/No response to thier respective
arrays (i.e. $name[] = $items['name']; $recordid =
$items['recordid'];)

Display the HTML, (inside use a PHP script to create the inputs)
- Using a loop read in the array values as inputs up to the counter
- - for input names use the array ID (i.e. ..name="name[]"> )
- (don't forget to include the array counter and the record ID array
as 'hidden' values.)
- submit

Reading back in the submitted form
- read through arrays
- - Do SQL updates with array data

Hope that helps!

Larry

Dec 20 '05 #2
many thanks!
<la***@portcommodore.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
That's more code than I want to write here also your form structure
would probably differ from mine, but I can say you got the general idea
there. Here is a general idea of how the code goes:

General structure would be
read in the data...
- set counter to 0
- select the records
- loop through the record with mysql_fetch_array
- - increment counter
- - Read in record ID, Name and Yes/No response to thier respective
arrays (i.e. $name[] = $items['name']; $recordid =
$items['recordid'];)

Display the HTML, (inside use a PHP script to create the inputs)
- Using a loop read in the array values as inputs up to the counter
- - for input names use the array ID (i.e. ..name="name[]"> )
- (don't forget to include the array counter and the record ID array
as 'hidden' values.)
- submit

Reading back in the submitted form
- read through arrays
- - Do SQL updates with array data

Hope that helps!

Larry

Dec 21 '05 #3

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

Similar topics

1
by: Raghuram Banda | last post by:
Hi, Can any one help me, how to create a Radio button using DOM with default one option is selected Thanks in advance
6
by: Craig Keightley | last post by:
I have a page that has n number of radio groups (yes/No) how can i prevent the form being submitted if more than one radio group is not selected? By default all radio groups are unchecked ...
4
by: TS | last post by:
My objective: To create a survey that asks people to rate a list of things in order of importance. I wish to prevent them from just rating every item in the list the same value. For example the...
2
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put...
2
by: NishSF | last post by:
Would anyone have any suggestions/javascript code so that if one clicks the Radio Button "Yes" below he has the option of selecting any of the six CheckBox below. If the user clicks on Radio Button...
5
by: Jan Smith | last post by:
I have a C# project that has a tab control with four tab pages. On each tab page is a set of three radio buttons (named radioButton1 through radioButton12). I would like to loop through the radio...
1
by: Christina | last post by:
Hi, I've been looking at some code for dependent list boxes to adapt to a State and City list. There will only be 2 states for the first list box, and 3 cities in the second list box. When the...
1
by: Ian Toltz | last post by:
I'm working on a "pokédex" for people who play Pokémon. I need to have a list of all the pokémon, along with a set of radiobuttons for each. I've initially tried a ListView control, with the...
3
by: norbit | last post by:
Hello, I’m new to learning JavaScript. I was trying out a simple script but I can’t seem to make it work: <HTML><HEAD><TITLE>Radio Buttons</TITLE> <SCRIPT language=JavaScript> function...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
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...

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.