Re: php and checkboxes
| From: | Iggy | Date: | Thu, 08 May 2003 19:14:35 +0000 |
| Subject: | Re: php and checkboxes | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19813@lists.php.net to get a copy of this message | ||
I did this:
$y = "yes";
if(!isset($_POST["Y"]))
$y = "no";
where "Y" was the name of the checkbox.
"Harpreet" <harpreet@crispincorp.com> wrote in message
news:015f01c3158c$0aa8df70$6001a8c0@harpreet...
> I have checkboxs in a form for deletion
>
> <input type=checkbox name="materialid<? echo
> $row["material_id"];?>">
> The above code create a checkbox for each row in the table.
>
> I would like to delete multiple records using the above.
>
> if i check 3 checkboxes for deletion and use
>
> matid1=$HTTP_POST_VARS["materialid$matid"]; to find out if the checkbox is
> checked. It works for the checkboxes that are checked but gives me an
error
> for the unchecked checkboxes.
>
> Erro message:
> Notice: Undefined index: materialid1020 in e:\..scripts\asset_delete2.php
on
> line 17
>
> Notice: Undefined index: materialid1030 in e:\..scripts\asset_delete2.php
on
> line 17
> and so on.
>
> How can i skip the ones i dont check at all or skip the error message frm
> showing. I dont care about the ones i dont check in the previous form.
>
> Thanks,
>
>
>