Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2009, 02:26 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Default Get value of check box after "uncheck"

Hi. I'm new to php.
Say I have a check box which is checked already. Now I need to uncheck it and when I press the submit button, I should get the unchecked value. Can anyone help me on this.

One.php

if($qry[0]!=$login_type)
{
echo "<td class=tabhead align=center style=background-color:#CC66CC><input type=checkbox name=disable value=a".$count." checked DISABLED /></br>".$slot_value."</td>";
}
else
{
echo "<td class=tabhead align=center style=background-color:#00CCCC><input type=checkbox name=enable[] value='--user ".$slot_value." --ne ".$nen." --timespec ".$slt."' checked ></br>".$slot_value."</td>";
}

One.php calls Two.php
Two.php

$enable_slot= $_POST['enable'];
$uncheck_slot= $_POST['uncheck'];

if ($uncheck_slot){
foreach($uncheck_slot as &$k) {
echo "<p>".$k." --reserve</p>";
}
}
if ($enable_slot){
echo "$enable_slot";
foreach($enable_slot as &$a) {
echo "<p>".$a." --unreserve</p>";
}
}

I get only the results only if checked. I think I'm doing a mistake in the code in red font.

Any help is appreciated.
__________________
Rummy





Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a files general property of "Type of file" GregSivers Visual Basic 2008 Essentials 7 June 3rd, 2009 09:38 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM
Chapter-5 on Intents:ContactPickerTester does not show the button "Pick a Contact" sunilm12 BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 April 15th, 2009 11:55 AM
What "build in" funtionality can databound controls use (like GridV.) use with mySQL? allan_ravn ASP.NET 3.5 Professionals 0 April 14th, 2009 03:20 PM
How to download Code in "Professional Active Server Page 3.0 " book. renjith0 All Other Wrox Books 2 April 2nd, 2009 05:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.