473,748 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Having Problems in passing the checkbox value to next page

7 New Member
Hi,
I am really having problem in checkbox....
i have a php page which displays the username retrieved from the database i want to create a checkbox for each username and pass the selected multiple checkbox value to another page after selecting any one of the option value from the select box and after clicking on "go" button.

In option value i have links to go for particular page.


Plz help me out........
Its very urgent......
Oct 20 '07 #1
11 8641
pbmods
5,821 Recognized Expert Expert
Heya, manjunath1985. Welcome to TSDN!

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
Oct 20 '07 #2
manjunath1985
7 New Member
Heya, manjunath1985. Welcome to TSDN!

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
here is the code
Expand|Select|Wrap|Line Numbers
  1. <input type="checkbox" name="candidateusername" value="select[]">
i want to put a checkbox for candidateuserna me retrieved from the database and pass the multiple username selected checkbox value to next page after i select
<option value="send_sms .php"> and after pressing "go" button.
but i am not able to view the checkbox value in the selected page.
Oct 22 '07 #3
manjunath1985
7 New Member
hi,
i am having some serious problem with checkbox....

here is the code
<input type="checkbox" name="candidate username" value="select[]">
i want to put a checkbox for candidateuserna me retrieved from the database and pass the multiple username selected checkbox value to next page after i select
<option value="send_sms .php"> and after pressing "go" button.
but i am not able to view the checkbox value in the selected page.

Plz help me out....
Its very urgent...
Oct 22 '07 #4
JeremyMiller
69 New Member
and pass the multiple username selected checkbox value to next page after i select.
Can you rephrase that so that it's more clear?
Oct 22 '07 #5
manjunath1985
7 New Member
Can you rephrase that so that it's more clear?
I have retrieved some usernames as per the code in one page. but i want to put a checkbox for all usernames and pass the same to the next page through the <option value="send_smd .php"> and after clicking on "go" button.
Oct 22 '07 #6
JeremyMiller
69 New Member
Oh, well you're totally confused. Try starting with this code:
[html]
<form method="post" action="send_sm s.php">
<input type="checkbox" name="candidate username[]" value="dude's name"> Dude's Name<br />
<input type="checkbox" name="candidate username[]" value="dudette' s name"> Dudette's Name<br />
... repeat as much as you want
<input type="submit" value="Go" />
</form>
[/html]

Then, in send_sms.php, you can do something like this:

[php]
<?php
foreach ($_POST['candidateusern ame'] as $a_candidate) {
//Do something for the candidate whose name is in $a_candidate.
}
?>
[/php]

Because of how checkboxes work, only those which are checked will be in the array.

Oh, and I have no idea what you're trying with the <option> tag, but it looks wrong.
Oct 22 '07 #7
manjunath1985
7 New Member
Oh, well you're totally confused. Try starting with this code:
[html]
<form method="post" action="send_sm s.php">
<input type="checkbox" name="candidate username[]" value="dude's name"> Dude's Name<br />
<input type="checkbox" name="candidate username[]" value="dudette' s name"> Dudette's Name<br />
... repeat as much as you want
<input type="submit" value="Go" />
</form>
[/html]

Then, in send_sms.php, you can do something like this:

[php]
<?php
foreach ($_POST['candidateusern ame'] as $a_candidate) {
//Do something for the candidate whose name is in $a_candidate.
}
?>
[/php]

Because of how checkboxes work, only those which are checked will be in the array.

Oh, and I have no idea what you're trying with the <option> tag, but it looks wrong.
Hey i wil make it clear now, see i have a php page called viewdb.php, this page displays a usernames retrieved from the database so i want to put a checkbox for each of the username in viewdb.php and pass the selected check box value to another page called send_sms.php... ...

Plz help me out with the code......
Thank you for replying to my thread.....
Oct 22 '07 #8
pbmods
5,821 Recognized Expert Expert
Heya, manjunath.

Checkboxes only appear in the submitted form when they are checked.
Oct 22 '07 #9
pbmods
5,821 Recognized Expert Expert
Merged duplicate threads.
Oct 22 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
7423
by: Renie83 | last post by:
What I have are two pages. One is a form with some input boxes and check boxes on it. It is posting to a different script page that inserts into a database and sends the fields through email. My problem is sending the information which is checked through to the next page. Each of my checkboxes is given the value of what should be inserted in the table and into the email. I just need a way of determining which checkbox is checked so I can...
4
4295
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field that has been modified/clicked the form doesn't always submit. When it does work, a Stored procedure is passed form variables and updates to the db are made. When it doesn't, its as if the form wasn't submitted, it reloads and resets the page, but...
4
4629
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input type="checkbox" name="chk_Complete" value="<%Response.Write l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked"%>> The code to captures the checkbox value in the asp page that builds the sql string is follows
1
11862
by: | last post by:
Hi, 1st, I did a search and could not find any info on this, the Google results were good, but I'm still have issues...So any help will be great. I have a frame page, which contains 3 frames (Left, Content, and Footer) In the content page, I have a checkbox, which value is a number (i.e. 500). I would like that, when a user clicks on this checkbox, it will send the value to my LEFT frame. My left frame has an array, where I'm going to...
1
1734
by: Marty Meyers | last post by:
TIA for your help! I have a page (code snip below) named "browse" which has a table in it with rows like this: 2003 1500 Silverado pickup red 51,024 $19,995 Details --------- each row of the table has a hidden id number which is to be passed on to the
4
1522
by: Kevin Davis | last post by:
Hello, I have the following problem with the checkbox. The issue seems to be that when I click on the following checkbox: <input type= checkbox id="checkbox1" name="<%response.Write "recount" & CoCount%>" value="<%=idx%>" > with the following values below:
3
6732
by: delram | last post by:
I'm trying to get user selections (using checkboxes) on one JSP page(A.jsp) and pass them on to another page. So I have one page with a list of dynamically populated items like this 1 2 ... ... n
4
2498
by: softwaregeek | last post by:
hi to all, I am having some problem in passing parameter..... My code looks like::: request.setAttribute("game",game); response.sendRedirect("profile.do?operation=select&max_profiles="+totalprofiles+"&fsa="+fsa+"&score="+score+"&gameid=" + gameid + "&locale="+locale);
11
2193
by: simon2x1 | last post by:
i have 3 pages,home.php, next.php page and other.php.in the home.php page i selected name from the database and i gave it a limit and also an if statement to echo next.for the next.php page and other.php i did the same thing but i indicate (where comp_id >3 limit 3) for next page (where comp_id >6 limit 3) for other page so as to display the next 3 name repectively and also echo next and back to go the previous page.how can i put these...
0
8832
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
9561
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
9381
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
9332
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
8252
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
6078
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
4608
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
3316
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 we have to send another system
3
2217
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.