Fat Galah NewsFat Galah NewsFat Galah BlogFat Galah Client LoginFat Galah Client Contact Details
Fat Galah Internet Design Studios
103 Burrendah Road, Jindalee, QLD

Local call: 1800 99 33 99 (Australia Only)
International Ph: +61 7 3715 5999
Ph: 07 37155999

How to get form fields using JS send to PHP

February 2nd, 2010

One of the easiest methods I have come across to grab all the field values in a form via javascript and pass through to php is by using jQuery and its serialize() function.

<form id="webForm">
All the fields in here
</form>

inside the JS function

var data = $("#webForm").serialize();

What this does is forms a string with the field name and value ie - name=Blah&address=10 Address etc

depending on what method you use to send, it just like getting a form submit with all the fields and they values.

Leave A Comment:

Name:(Required)
XHTML ValidationCSS Validation