• Hi, everyone. I’m a relatively new developer with limited experience in jQuery AJAX and PHP. I’m working on a plugin that is very much a learning exercise for me as well.

    Basic description: On my plugin’s admin page, I have a bunch of forms that will be displayed as modal windows (using jQuery UI) and when filled out, will submit their fields to a separate PHP file for processing. That file will accept the data and prepare it for insertion into the wpdb table I have set up.

    Plugin Admin page (PHP):

    <div id="form1" title="My Awesome Form">
    	<form id="frmNewCom">
    		<fieldset>
    		<table>
    			<tr>
    				<td><label for="name">Community Name</label>
    				<td><input type="text" name="newComName" id="newComName" />
    			</tr>
    			<tr>
    				<td><label for="lefthead">Left Column Header</label></td>
    				<td><input type="text" name="newComLefthead" id="newComLefthead" /></td>
    			</tr>
    			<tr>
    				<td><label for="righthead">Right Column Header</label></td>
    				<td><input type="text" name="newComRighthead" id="newComRighthead" /></td>
    			</tr>
    		</table>
    		</fieldset>
    	</form>
    </div>

    jQuery UI code for form ($pcal is my no-conflict thing):

    $pcal('#form1').dialog({
    		autoOpen: false,
    		height: 275,
    		width: 400,
    		modal: true,
    		buttons: {
    			"Add Living Option": function() {
    				// Functionality for submit
    			},
    			Cancel: function() {
    				$pcal(this).dialog("close");
    			}
    		},
    		close: function() {
    			// close function
    		}
    	});

    Now here’s the problem. I’m not really sure what to do from this point. I’ve read a bunch of stuff about using .post() and .serialize(), and I’ve gotten myself very confused at this point.

    Do you guys have some insight into the proper javascript/jQuery to PHP handling you could lend? Any and all help is appreciated.

  • The topic ‘jQuery to PHP data transfer’ is closed to new replies.