Bluehost.com Web Hosting $6.95

Problem with PHP checkboxes

This is a discussion on Problem with PHP checkboxes within the PHP General forums, part of the PHP Programming Forums category; Hi, everybody ! I'll try to explain as clear as possible Here is what I have: 2 MySQL tables - 1st - ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-24-2003
Dmitry
 
Posts: n/a
Default Problem with PHP checkboxes

Hi, everybody !

I'll try to explain as clear as possible

Here is what I have:
2 MySQL tables -
1st - list of items available for order (about 300 of items)
2nd - list of items that one particular client orders (somewhere
between 50 to 120 items).

One of my forms shows to the client a list of items available for his
order, also it has an option to add items to that list. - That where I
having a problem.
What I want to do is to display list of all items available for
everybody, but with items that client already have being checked and
disabled so he (client) can check additional items and submit changes
later.

The part where " ... items that client already have being checked and
disabled ... " apparently being a problem.

Here is a part of code that I'm using:
<?
....

Querying part and beginning of HTML goes here

....

while ($row_rs_items = mysql_fetch_assoc($rs_items)) {

$row_rs_list = mysql_fetch_assoc($rs_list);

if (array_search($row_rs_items['item_num'], $row_rs_list) == NULL)
{
$flag = "";
} else {
$flag = " checked disabled";
}

?>

<tr bgcolor="<? echo $bgcolor; ?>">
<td><? echo $i; ?></td>
<td><? echo $row_rs_items['item_num']; ?></td>
<td align="left">&nbsp;&nbsp;&nbsp;<? echo
$row_rs_items['description']; ?></td>
<td><? echo $row_rs_items['vendor_name']; ?></td>
<td><? echo $row_rs_items['unit']; ?></td>
<td><div align="center">
<input type="checkbox" name="<? echo
$row_rs_items['item_num']; ?>" value="checkbox"<? echo $flag; ?>>

....

Any ideas ?
Any suggestions are deeply appreciated!

Thanks.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 04:32 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0