8,849
edits
Changes
Savefunc
,no edit summary
{{JavaScript Syntax}}
You can use '''savefunc''' to create a custom [[Browser Script]] that runs whenever a user clicks '''Save''', '''Save Draft''' or '''Submit'''.
'''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
}
}
* [[onloadfunc]]
[[Category:JavaScript]][[Category:Validation]]