Jump to content

[SOLVED] when i check a checkbox another one checks


berry05

Recommended Posts

Hello,

 

I have a php code that shows the field of a table and next to each field is a checkbox...when i check one box the other one checks also..here's a piece of the code..

 

echo  $row['item'] ."<input type='checkbox' name='checkbox' id='checkbox'>"  . "<BR />" ;

 

any help would be great!

 

thanks!

You probably have "checkbox" as the name for both boxes. The name needs to be somewhat unique or an array.

 

echo  $row['item'] ."<input type='checkbox' name='checkb[]' id='checkbox'><BR />" ;

 

Notice I renamed it to checkb as well, as "checkbox" may cause issues. This would avoid them.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.