Changes

Savefunc

121 bytes added, 19:56, 13 May 2014
no edit summary
{{JavaScript Syntax}}You can use '''savefunc''' to create a custom [[Browser Script]] that runs whenever a record is saved user clicks '''Save''', '''Save Draft''' or submitted'''Submit'''.
'''Instructions:'''
'''Example 1:'''
function savefunc(frm){ { ''do this'' ''RunAnotherFunction()'' ''do that'' return true }
* The following sample [[JavaScript]] function will prompt the [[User|user]] to confirm if they really want to save the record.
<pre>
function savefunc(frm){ var answer = confirm ("Do you really want to save this?") if (answer) { alert ("Consider it done") return true }else { alert ("Keep filling it in then") return false
}
}
* ''The "return false" isn't strictly necessary. If the function does not return true then false is assumed.''
===See Also===* [[sbfunc]]* [[onloadfunc]] [[Category:JavaScript]][[Category:Validation]]
8,849
edits