Validating a document in WebQuerySave?

I am trying to implement a Turing Number on a web page. I don’t really want to store the number on my webpage so I can’t validate with javascript. So I need to validate in WebQuerySave.

The help file says all you need to do is to set SaveOptions to “0” so I created the following agent as a test.

Dim session As New NotesSession

Dim doc As NotesDocument



Set doc = session.DocumentContext



doc.SaveOptions = "0"



Print "Hello"

Basiclly the agent should not allow anything to be saved but the document is being saved. What am I doing wrong?

Of course once I get this simple agent working, I’ll add code to validate the Turing Number.

As a second part of the question, I want to be able to redisplay the form, with all of the fields filled out, in case the user enters the Turing number incorrectly. How can I redisplay the form and populate it with the values that the user entered previously?

Subject: Validating a document in WebQuerySave?

It sounds like you want the best of both worlds here - you want to post the document back to the server for validation there but you want to preserve the browser session.

I’ve seen techniques to preserve the page’s state mentioned in this forum but if I remember correctly they involve some overhead. You may want to consider a validation solution that uses ajax to call a web service on the backend for validation without actually submitting the page.