Ritu Singh
Problem
I'd like some help. I have the HTML form fields below and I want them to be sent to a PHP page to individual PHP arrays.
HTML
Javascript:
PHP
Edit, removed already tried code.
Solution:
jQuery provides the serialize() function, which provides a really simple way to get all the data from a form or a specific set of fields and convert them into the form-url-encoded format that they would ordinarily be transmitted in if you submitted a regular form (without AJAX). This is the format PHP recognizes and will automatically convert into data in its $_POST array.
This little demo shows
What serialize() outputs
A way to select the specific fields you're interested in using a class name (notice the extra class on each input field in the HTML)
A nicer way to handle the "change" event unobtrusively using a selector, rather than littering the HTML with onchange attributes.
So if you wanted to use it in your AJAX, you'd end up with something like:
Answered by: >ADyson
Credit: >StackOverflow
Blogs Link:
>How to solve the encoding issue when writing to a text file, with Python?
>How to solve problems with Python syntax while writing a calculator app?-Python
>How to solve XGBoost model training fails in Python
>How to route between different components in React.js?
>How to build interactive_graphviz in Python