sunil_snlx Posted February 9, 2010 Share Posted February 9, 2010 hi,there's a problem with my php code and i cant seem to get it right. the problem is in a form with checkboxes which are in a hierarchy ie there's an "All" checkbox which is self explanatory and inside there are subgroups like IIA,IIIA etc which again has names of persons which are all retrieved from the database inside a while loop. Now on clicking the subgroups for ex. IIA all the names inside of the subgroup are selected and are displayed on a textarea on the same page........and on click of submit these selected names should be passed to the next page to insert the names in the database.Ive been trying to do this for sometime now and ive already wasted a lot of time on it and im not able to figure it out since i'm a beginner and its very urgent that i solve this problem. plz help. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/191507-values-of-checkbox-sent-on-submit/ Share on other sites More sharing options...
bullbreed Posted February 9, 2010 Share Posted February 9, 2010 post your code please Link to comment https://forums.phpfreaks.com/topic/191507-values-of-checkbox-sent-on-submit/#findComment-1009566 Share on other sites More sharing options...
sunil_snlx Posted February 9, 2010 Author Share Posted February 9, 2010 hey ive attached a php file select receipients......the whole code is in that file....help needed urgently Link to comment https://forums.phpfreaks.com/topic/191507-values-of-checkbox-sent-on-submit/#findComment-1009598 Share on other sites More sharing options...
chrisroane Posted February 9, 2010 Share Posted February 9, 2010 Without spending a lot of time on this, have you verified that all of the data is in the $_POST array on the processing page? On your processing page, put this code: echo '<pre>'; print_r($_POST); echo '</pre>'; exit; and see if all of the checkbox data was included right. If it wasn't, than there may be some issues with your JavaScript. You could also try putting in a unique "id" value for each checkbox (which you could do with a simple counter variable). If this still doesn't help you figure it out, let me know and I can take a closer look. Link to comment https://forums.phpfreaks.com/topic/191507-values-of-checkbox-sent-on-submit/#findComment-1009655 Share on other sites More sharing options...
sunil_snlx Posted February 10, 2010 Author Share Posted February 10, 2010 ive made some minor adjustments and now its taking values of ALL GROUPS,and subgroups ie IIA,IIIA etc...but if i click on individual checkboxes inside the groups ie for eg..inside IIA-->abc,pqr . if i click on abc and so forth those values are not being accepted......man i dont wanna mess up the code any further.....im attaching the code plz suggest what to do in order to make it work. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/191507-values-of-checkbox-sent-on-submit/#findComment-1009894 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.