About This Code
Brief Description:
Form Validation on the Web Using AJAX
Contributor:
Prabagarane Govindan
Category:
Javascript, Lotusscript, XML/XSL
Last Modified:
23 Jun 2006
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
This simple example demonstrates the usage of AJAX for field validation on the web. For demo purpose, the form checks the duplication for 'AlbumID'.
Check the following design codes.
1. 'Album' form - under 'JS Header' and 'Submit' button.
This example is tested in R6.5x and Internet explorer 6.x
Usage / Example
1. Sign off the database with server ID.
2. Open the database on the web and click the 'New Album'
3. In the next screen, enter '5' (existing ID) and click submit.
4. The user alerted with message box saying that number already exists.
What it does behind the scene in Submit button is a web request is sent to server to find out the 'AlbumID' entered is unique. If it is unique, it returns 'true' otherwise 'false'.
Code Attachments
Comments
Posted by Frederic Dehedin on 05/05/2006 01:23:36 AMdoes not work..
i can save as many "test" Album-IDs as i want to...
does it only work for IE or Firefox? i tested both..
Posted by Prabagarane Govindan on 06/23/2006 02:13:08 PMTry now
I've updated the code to check for unique. I was busy with other work and haven't checked your comments until now.