Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Cancelling saving of form in preSave event

Avatar

Level 1

I am performing cross field validation before saving the form (in preSave event) and want to cancel the saving of the form. I have tried returning 0, false, but nothing seems to work and the form is saved anyway. How can I cancel the saving of the form?

4 Replies

Avatar

Level 10

Can you explain what you meant by Saving of the form.. Are you using File -> Save (or) placing a button on the form and on the click of it you atre trying to save the form?

Thanks

Srini

Avatar

Level 1

I mean, when I click on the Small Disk or File->Save or even on the File->saveAs, I would like to block any kind of saving of the form until all my validations have been sucessfully met. I will also want to do it for any Print functionality.

Avatar

Level 4

One thing you could try, and this may not be remotely close to what you want, but on the preSave/Print events, you can do validation for required fields and such, and if they are not completely filled in, change the content area to display a message like "you tried saving an incomplete form.  Please fill out the form again".  Then if they print the form, that's all they see instead of the content.

Edit: I actually did this on a form...if it wasn't showing a barcode, I set the page content to "invisible" and on the postPrint (and alerted the user), I turned it "visible" again so they could fill out the form or change what they needed to.