Darlene Jonas | Tonya Stclair | Chris Fordham |
Glenn Tetreault | Christopher Wolford | Jonathan Savage |
Travis Liles | Keith Hubbell | Christopher Hamann |
Virginia Quade | Irma Gregg | Johnny Foss |
Pam Farwell | Lydia Berkley | Michelle Mowry |
Larry Womble | Russell Schumann | Kimberly Browne |
Timothy Laboy | Paula Rivera | Maryann Austin |
Dora Copeland | Dolores Tyson | Evelyn Sutton |
Ernest High | Marvin Hoppe | Sharon Olander |
Harriet Wilde | Raymond Rickert | Chris Nalley |
Example shows how to save form data using AJAX.
After element from the left table is moved to the dropzone, it will be expanded with displayed form elements.
If expanded DIV element is returned back to the left table, nothing will happen (DIV element will be returned to the initial form).
On the other hand, form data can be changed and saved.
JavaScript will call PHP script and try to save form values.
In this demo, PHP script will "fake saving" and return "OK" string so client logic will think that server job is done correctly.
In this case, client side will update innerHTML of DIV element and new name will be displayed when DIV element will be returned to it's place on the left table.
But, when the updated DIV element will be dragged to the dropzone again, old name will be displayed.
That's not a BUG, because nothing is actually saved in previous step.
If you will use this demo, you will need to change mylib.php, db_ajax.php and db_save.php.