@dblookup/Javascript in web

Hi all, I’m have a requirement. I have a field called “Company name” and is unique. So i want to control the users while entering the same company name. In client i can validate @gblookup/getdocumentbykey… and in web how can i control… If i do in querysave event… document getting saved… Any suggestions…!!

Thanks in advance,kk

Subject: Strategies on validation

If the number of company names aren’t too large, I’d download them into a JavaScript array with passthru HTML of something like:“”

and then use that in the onSubmit event so that if it’s a bad company name then tell the user and return false.

But you should provide client-side validation for better use experience but not rely on it. (someone might be using their phone’s web browser with javascript disabled, for example)

The “ugly-but-functional” way to do it is to validate using a WebQuerySave agent and, if data is invalid, set the SaveOptions field to “0” (text of “0”, not number of 0) which will prevent the save and then use print statements to make a quick and dirty HTML page that tells the user what’s wrong and to hit their back button and try again.

Ideally, you’d have something like that (except prettier) to protect your app from javascript-disabled browsers and people who want to screw up your data, but you’d rely on client-side validation for your user interface so that the feedback is immediate.

If there are too many company names for you to download all at once into the form, look at Julian Robichaux’s google-suggest type lookups at nsftools - JavaScript Tips and you should be able to figure out better client validation from that.