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
https://forums.phpfreaks.com/topic/241835-send-data-post/
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
https://forums.phpfreaks.com/topic/241835-send-data-post/#findComment-1243664
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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