473,770 Members | 4,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2001
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_arr ay
- - 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***@portcomm odore.com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.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_arr ay
- - 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
20462
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
3293
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 The problem i am facing is that i do not know how many yes/no radio groups will be generated
4
2844
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 Page would look roughly like this: Please rate the following in order of importance: Item Rating Apples 1 2 3 Orange 1 2 3
2
11980
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 them each in a GroupBox. All the examples I saw from the books or from the web show me how to add static radio buttons at design, or dynamically at run time but with fixed radio buttons (like from an array). I need to create radio buttons based...
2
3493
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 "No", he should not have the option of clicking on any of the six checkboxes. See Code attached. Thank you so much in advance for your help as I can't get to make this combo work. <p>Did you have any problems finding any of the information...
5
3569
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 buttons and set their state without having to form the complete name of each one, something like this: public static void SetButtonState(Form frm, int ButtonCount) {
1
4388
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 state is selected, the relative cities appear in the second box. I found a nice set of code online that was derived from Dreamweaver code and have altered it to simplify for my minimal needs. I have learned a lot of coding from looking at...
1
7262
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 details view, but if it's possible to add a radio button I can't figure out how. I know that I've seen an example of an application that had a list of things with checkboxes before when I was first learning c#, but I can't for the life of my...
3
2020
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 process()
0
9439
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
10237
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
10071
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
10017
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
8905
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...
1
7431
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
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
5326
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...
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.