berry05 Posted May 8, 2009 Share Posted May 8, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/157400-solved-when-i-check-a-checkbox-another-one-checks/ Share on other sites More sharing options...
mrMarcus Posted May 8, 2009 Share Posted May 8, 2009 perhaps providing the other checkbox would help. Quote Link to comment https://forums.phpfreaks.com/topic/157400-solved-when-i-check-a-checkbox-another-one-checks/#findComment-829755 Share on other sites More sharing options...
berry05 Posted May 8, 2009 Author Share Posted May 8, 2009 perhaps providing the other checkbox would help. what you mean? thats all I have that echoes Quote Link to comment https://forums.phpfreaks.com/topic/157400-solved-when-i-check-a-checkbox-another-one-checks/#findComment-829756 Share on other sites More sharing options...
premiso Posted May 8, 2009 Share Posted May 8, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157400-solved-when-i-check-a-checkbox-another-one-checks/#findComment-829757 Share on other sites More sharing options...
berry05 Posted May 8, 2009 Author Share Posted May 8, 2009 lol there was a piece of HTML code interfering with it... thanks all! Quote Link to comment https://forums.phpfreaks.com/topic/157400-solved-when-i-check-a-checkbox-another-one-checks/#findComment-829764 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.