onchange to save

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
tmnt_2408
User
Posts: 79

onchange to save

Post by tmnt_2408 »

How to trigger "save" with onchange function in add or edit page?

Regards,
Luki


danielc
User
Posts: 1601

Post by danielc »

To trigger your action if your "save" is like add/edit button, just add (see api.jquery.com/click/) :
#<yourid>.click();


tmnt_2408
User
Posts: 79

Post by tmnt_2408 »

Can the 'save' action be triggered by onchange function, means like when you change value in a textbox?


danielc
User
Posts: 1601

Post by danielc »

There is no "save" button in the generated file. Is it specially created button? Or you mean add/edit?

Yes, you can trigger .click event inside onchange event (I assume you want to click your save button just like add/edit button).


tmnt_2408
User
Posts: 79

Post by tmnt_2408 »

Dear Daniel,

Yes, save button means add/edit button.

Can you share to me an example of .click event inside onchange event?

Thank you for your kind support.

Regards,
Luki


danielc
User
Posts: 1601

Post by danielc »

Just add this code to your onchange event:
$("#btnAction").click(); // id for add/edit button.


tmnt_2408
User
Posts: 79

Post by tmnt_2408 »

Dear Daniel,

It works :)

Thank you very much...

Regards,
Luki


Post Reply