Pass multiple values through and process them

Unforgiven

New Member
I have a form that adds a hidden field for every object in the list and this is then picked up on the next page with a foreach. It all works fine.My question is that I need to add another variable into that list. So far this is date/time. How do I get another value to be picked up by the same foreach?ThanksThe Form:\[code\] <form action="test.php" id="calendarform" method="post"> <input type="submit" value="http://stackoverflow.com/questions/10548703/Export Calendar"/> </form> \[/code\]The jQuery:\[code\] $('#calendarform').submit(function(e) { var form = $(this); var listItems = $('.listItem'); listItems.each(function(index){ //For each event do this: var listItem = $(this); $("<input type='hidden'/>").val(listItem.text()).appendTo(form).attr('name', 'listItem[' + index + ']'); });\[/code\]On the response page:\[code\]foreach($_POST['listItem'] as $key => $value){ $eventDate = trim($value); }\[/code\]And finally how I would like it to work:\[code\] foreach($_POST['listItem'] as $key => $value){ $eventDate = trim($value); $eventTitle = trim($value2); }\[/code\]
 
Back
Top