Jump to content

send data POST


ueon

Recommended Posts

I'm trying to make it so that when I click on the button, data in the 3 input fields above is sent to education.php as POST data. I spend the day looking at the jQuery and is having a hard time applying it since I don't have a javascript background. I'm barely getting by with AJAX and AJAX is a crucial component in this project.

 

what is the AJAX/jQuery snippet to make the following code work?

 

echo "<input id='uni' value='$uni' type='text' />";

echo "<input id='class' value='$class' type='text' />";

echo "<input id='program' value='$program' type='text' />";

echo "<input id='submitedcu' value='Save Education' type='submit' />

Link to comment
Share on other sites

I'm not going to give you the code that does what you want. But I will give an attempt to explain how to do it.

First you need to get the values from the input elements which would look something like this using jQuery.

 

jQuery('input#your_id_attribute_here').val();

You can get more info from the manual here http://api.jquery.com/val/

 

As for making the post work check out:

http://api.jquery.com/jQuery.post/

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.