I’ve done very little web development in Notes, and am having trouble figuring out where and how to validate a field when the user clicks Save & Close on the web.
I’ve tried Formula in the QuerySave, Formula in the Save & Close button, Javascript in the JS Header, and even Javascript in the Submit section. Nothing seems to stop the user from saving, let alone throw up an informational box.
What the heck am I doing wrong?
My JS code looks like this:
var form = document._F1;
// Added by Greg Gartland [11/30/2006] - field validation for ScratchPad
if (form.ScratchPad.value == “”){
alert(“You need to enter History at the bottom of this document”);
You may want to view the page source and be sure the form is called _F1.
Where is your code? I suggest using the onSubmit event for the form. If you use the button to place your code than you will have to add code to call submit() if the field passed validation.