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 - ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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"> <? 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. |