Johnny,
I assume you want to do the following?
1. Capture data from a user input.
2. Send data to PHP via $.Post.
3. Return data to user screen via pop up box or put it on screen?
This function will capture an array from a user with the value of name="main_occupancy[]" from a group of checkboxes
- function get2() {
- var main_occupancy = $('input[name="main_occupancy\\[\\]"]:checked').
- map(function(i, elem) { return $(this).val(); }).get(); //gets array
- alert(main_occupancy); //alerts array to screen for error checking purposes
- $.post('data2.php', {main_occupancy: main_occupancy}, //sends variable back to php file
- function(output) {
- $('#input16').html(output).show(); //returns data to <div id="input16"> on original page
- });}
you can change the $.('input[name="to any freaking thing on the page"]') and it should work. Check out the video tutorials on the new boston . org.
You need an input button on main page to submit onclick="get2()"