Last post Aug 23, 2016 12:37 PM by Fouad Roumieh
Aug 18, 2016 05:43 PM|Fouad Roumieh|LINK
There is a java-script functionality that allows you to alert the users about a change they made on an input but they didn't hit the save button for example, and at the same time trying to browse to another page. Like in the below example:
When it comes to modals that are generated on the grid edit actions for example, is there a simple way to attach the above functionality to the modal but without implementing the code inside the close click event handlers of the modals?
Aug 19, 2016 05:59 AM|Ailleen|LINK
Hi Fouad Roumieh,
is there a simple way to attach the above functionality to the modal but without implementing the code inside the close click event handlers of the modals?
Then when will you show the modal popup ? Please explain more about your requirement .
Aug 19, 2016 11:10 AM|Fouad Roumieh|LINK
The modal will be showing on the grid action as usual, but if the user changed any value within the input field without hitting Save button, then they hit the close (the changes are still inside the input) there will be an alert that there changes that you
may lose if you leave.
My question is that I don't want to implement this logic/check within the close event of each modal? Is there a way to handle this in a generic way for every modal on each page?
Aug 22, 2016 11:44 AM|Ailleen|LINK
Firstly, from your description, you could use
F12 developer tools DOM Explorer to find the event, then delete it. Secondly, you could set breakpoint to debug your code, then find the method and remove it.
The following link is for your reference.
Aug 22, 2016 07:06 PM|Fouad Roumieh|LINK
You didn't get my question. I want to know how to trigger a modal has been loaded on any page and then attach script to.
Aug 22, 2016 07:25 PM|mgebhard|LINK
Just use a JQuery selector that targets only the inputs within the modal.
Aug 23, 2016 12:37 PM|Fouad Roumieh|LINK
Thanks for your input, the issue is more related to triggering that a modal has been loaded on the page and then activate the script that you sent on that modal. I'm trying to make this like a global configuration on the modals, rather than setting up each
one events on its own.