jgingras Posted September 20, 2005 Share Posted September 20, 2005 (edited) Hi, im having a problem with a page that has multiple checkboxes with the same name. When I do $_REQUEST["CheckBoxname"], it only returns the last checkbox checked. How can I walk through all of the check boxes in PHP? Thanks, -jacques Edited September 20, 2005 by jgingras Quote Link to comment Share on other sites More sharing options...
TweezerMan Posted September 20, 2005 Share Posted September 20, 2005 The first step is to make sure your form is actually passing an array of checkbox values to your PHP script. In your form, your checkboxes should have name="CheckBoxname[]" (not just name="CheckBoxname") to indicate they are part of an array. Once the form is passing an array correctly, it should be relatively easy to have your script iterate through the array's values. Quote Link to comment Share on other sites More sharing options...
jgingras Posted September 20, 2005 Author Share Posted September 20, 2005 The first step is to make sure your form is actually passing an array of checkbox values to your PHP script. In your form, your checkboxes should have name="CheckBoxname[]" (not just name="CheckBoxname") to indicate they are part of an array. Once the form is passing an array correctly, it should be relatively easy to have your script iterate through the array's values. thanks a lot Dave! that worked great! -jacques Quote Link to comment 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.