Link to home
Start Free TrialLog in
Avatar of William-B
William-B

asked on

Obtaining array in POST variable

Hello,

I'm trying to find a way to obtain a subset array from the passed POST array in a php function.  Right now my html form has one input into which a number is typed.  Based on that value a number of checkboxes will appear after it.  What would be the best way to obtain the array of checkbox values from the POST?  I am submitting the form using AJAX and .serializeArray() for the form.  Would it be best just to copy the array, trimming out the first entry, which is the first input value?  So if the POST was: input=4 cb1=1 cb2=0 cb3=0 cb4=1, just create a separate array starting at index 1?  If anyone has any ideas or opinions please let me know.
Thanks,
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of William-B
William-B

ASKER

Thanks a lot guys, I really liked Ray's article and both Dave and Chris brought some issues that I hadn't considered to my attention.  I might end up using the hidden control method, just because using the array ID's it should be relatively easy to implement, that way I can have the values of all the controls.  Thanks again