Just kidding I was just looking for an eye catcher…
Maybe you have already seen my announcement that I have released v0.17 of the ApexLib Framework, which contains a lot new features.
The previous features in the Framework mostly concentrated on improvements of Oracle APEX on the server, so that’s easier to access Tabular Forms or do automatic validation of date picker or numeric items. The main idea was to make APEX applications more secure without having to do a lot of additional coding. Quoting from Securing Web Applications
The #1 rule that all web developers should never forget is “Don’t trust end-user data!”. With this in mind, when designing html forms it is extremely important to have appropriate server-side validations for every field.
I will probably add more server-side checks on the server, just to make sure.
But my long term goal was always to bring more interactivity to the browser, without having to submit the page. The first step was the AJAX enabled Generic solution for cascading lovs, the next step is now
Out-of-the-box client side validation for required-, date picker- and numeric items
What will you see there?
- Immediate check of a required field as soon as you leave the field. It’s a “soft” check which just shows an inline error message (no ugly alert boxes), informing the user that the field is required.
- Immediate check of date and number fields if the entered value matches to the defined format mask. It’s a “hard” check, at least on IE the cursor will stay in the field. IE isn’t spec conform here, but in that case it’s good that it isn’t
- Date and number values are formated according to the format mask. Eg it will fill up the cents with 0 if you only have entered a full dollar amount, or it will add the currency sign (Oracle validation would fail if you don’t enter the currency sign!) and so on.
- As soon as you correct the error, the error message is removed so that the user gets a visual feedback that the error has been fixed.
- All the checks are NLS aware, so if your database settings return the Euro sign or use a comma instead of the period for the decimal point, the library will handle that. It should also support all the different date format masks. Also the weird American ones with AM/PM and the month at be beginning…
- When the user tries to submit the page, the above checks will be done again. If one of the checks fails the submit is aborted until the user corrects the error.
- The library is aware of existing onchange/onblur events which are registered for the fields and executes them after its checks.
Want to have this client side checks in your application?
Read the “How to integrate” posting I have done. That’s all, the rest is done by the Framework.
Note: It’s build that way that you can also apply it to an existing application. It will just enhance it.
Doesn’t work as expected?
Please read the FAQ on the Automatic required and date picker/format mask check for page items postings for debugging and some basic tests. Still doesn’t work? Send me an e-mail (can be found in my profile) or write an comment.
Roadmap for future development
Next step will be to do the same checks for tabular forms. After that I will try to add some more client side checks. Eg some of the validations which have been defined for the page.