Welcome, Guest
Username: Password: Remember me

TOPIC: Auto save without page refresh

Auto save without page refresh 15 Jul 2016 14:26 #14266

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
I have a form which has elements triggered by previously filled fields

I would like certain fields to trigger the SAVE functionality onChange, then refresh the form view that the user is CURRENTLY ON without reloading the page. I can alter the value of individual fields with an onChange request, but not attempted to fire the view.save function

Is this possible? Has anyone accomplished this or is the Joomla framework too rigid to allow it without hacking core component? I am guessing it will actually require a recode of the save function
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

Auto save without page refresh 15 Jul 2016 14:45 #14267

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Try playing with:
onclick="return Joomla.submitformAjax('demoitem.apply');"

BTW: this is the type of code utilized by the "save" of a modal form
Last Edit: 15 Jul 2016 15:06 by vlemos.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Auto save without page refresh 15 Jul 2016 18:00 #14270

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
When you open a form in modal, if you click "Save and Close" then your form is fully sent in Ajax. And the response is checked to know if staying on the page, or closing the modal. This is already in Ajax in your component.

(BTW there is an issue with AJAX files uploads at the moment.)

If you click Save, or Save and New, then the page is called in normal request because in both case it will keep the modal open, so JS do not deed to call in ajax.

Look in the JDom assets (toolbar.js) There you will find the Ajax features.
Coding is now a piece of cake
The administrator has disabled public write access.

Auto save without page refresh 15 Jul 2016 18:02 #14271

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
vlemos wrote:
Try playing with:
onclick="return Joomla.submitformAjax('demoitem.apply');"

BTW: this is the type of code utilized by the "save" of a modal form

Arff, I see your answer now.
Perfect answer, shorter and better than mine.

Vlemos, always brillant. You are our javascript guru.

K++
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: vlemos
Time to create page: 0.071 seconds

Get Started