Hi
What the is easiest way to tell if a form has been edited via Javascript?
i use nuAddActionButton to add the ability to run a report from an 'edit form' but i only want the report to run if the data is 'saved'. So basically when the save button is not red.
nuHasBeenEdited(). nuHasNotBeenEdited() only alters the status. i tried using nuIsSaved() in the Action Button function but that just kept returning false and i couldn't see anything in nuCurrentProperties. Any ideas?
Andrew
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
How to tell if the form has been edited in Javascript
-
- Posts: 75
- Joined: Tue Dec 26, 2017 8:58 pm
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: How to tell if the form has been edited in Javascript
Hi,alf1976 wrote: i tried using nuIsSaved() in the Action Button function but that just kept returning false
nuIsSaved() doesn't seem to work for me either (always returns false).
Maybe a workaround: Check if the save button is not red:
Code: Select all
if (!$('#nuSaveButton.nuSaveButtonEdited').length) {
// run report
}
Last edited by Anonymous on Sat Jul 21, 2018 7:41 pm, edited 1 time in total.
-
- Posts: 75
- Joined: Tue Dec 26, 2017 8:58 pm
Re: How to tell if the form has been edited in Javascript
Hi Toms,
thanks, that is a useful workaround.
i can get nuIsSaved() to return true, but only when it placed in the code section that runs when the form opens . ie
The wiki does say 'Used to tell if the current Edit Form has just been Saved'. So i suppose it does do what it says.
thanks, that is a useful workaround.
i can get nuIsSaved() to return true, but only when it placed in the code section that runs when the form opens . ie
Code: Select all
if(nuFormType() == 'edit')
{
if(nuIsSaved()===true)
{
// do something...
}
if (nuIsNewRecord()===true)
{
// do something
}
}
Re: How to tell if the form has been edited in Javascript
alf1976,
I believed I have fixed it now.
Let me know if nuIsSaved() works for you now.
Steven
I believed I have fixed it now.
Let me know if nuIsSaved() works for you now.
Steven