By marknbiz on
Hi, all
I changed the view page of drupal to edit contents by jQuery methods.
But I couldn't save the edited contents like in the editing page.
I tried to make "save contents" button to save contents of a specific text area.
I changed the source code to be able to edit the specific text area by jQuery.
I'd like to save this edited contents in the text area by the custom button which I tried to make.
Does somebody have any suggestions?
Thanks
Comments
Use ajax calls
I take it you're using D5 from the tags. If not, have a look at the services module for the backend + jQuery.
Regardless, the following method should work.
On the front end, then button should call jQuery.ajax() or jQuery.post().
You can then implement menu item with a custom callback (hook_menu) which you can then post to via ajax when the user submits. The page_callback should then be in charge of saving the content. You will also need to do the validation in this callback.
The backend should look vaguely like this: