Jump to content

values of checkbox sent on submit


sunil_snlx

Recommended Posts

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

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.

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]

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.