Form validation in Blackberry

Hi all,

I created a simple form which i wanted to test in the Blackberry device. It contains a field validation written in javascript. It works fine in the PC browser but NOT in the Blackberry internet browser.

here’s my simple test code:

if (doc.myfield.value == "')

{alert(“can’t leave this field blank”)}

else

{alert(“pass”)}

I always get a ‘pass’ when i use the blackberry internet browser. Is Javascript not fully supported in this environment ?

I have heard of the use of the Push technology to make this application works in the mobile device. Is this the only way to achieve usage compatibility ?

Hope someone can enlighten me on this ?

Cheers to all.

:slight_smile:

Subject: Form validation in Blackberry

NEVER depend entirely on JavaScript for validation. Think of it as a user convenience, designed to avoid a wait for gross errors. Do your real data validation at the server, either using the field input validation events or a WebQuerySave agent. (And no, JS isn’t properly supported everywhere – and even if it were, you can’t count on the object model of the user agent being the same as IE or NS/Moz.)

Subject: RE: Form validation in Blackberry

Stan,

If you can help me, I’d appreciate it very much. I also have an app that I am allowing BB users to access via the web. The app is currently used only by Notes client, but I have added a new view and form for BB users. It is an approval app and the validation works fine, but if the user hits the back button on the BB, he is able to approve again because the browser has not refreshed. How should I work around this? I’d like to close the BB browser, but I don’t know how. I am new at BB / web dev and any help you can provide would be appreciated.

Subject: RE: Form validation in Blackberry

Hi Stan,

You mentioned two options on where to place the field validations, namely:

a. Input validation

I tried it in one of the fields…

@if(myfield = “”;@failure(“Please enter something”);@success)

The thing is when i hit the save button, naturally my window will be refreshed and my error message apprears on it. This doen’t look friendly at all, considering there are several fields where validation is required. The question here is, how to make this more user firendly, any hint.

b. using WebQuerySave

Here I noticed more option (language wise) to choose from. Any hint of how to use them, say using Lotus Script. Do i use the Print statement to direct me to the error message window.

What i’m trying to achieve here is to the same experience that I have when using Javascript in the onSubmit.

Any help would be greatly appreciated…

Thanks so much Stan…

Lisa I would like to know how did u manage to make the validation work in your BB device…

Cheers to all and have a good day.