View Single Post
  #1 (permalink)  
Old 02-11-2008, 04:03 PM
antonypeiris antonypeiris is offline
Newbie
 
Join Date: Sep 2007
Posts: 3
Credits: 0
Rep Power: 0
antonypeiris is on a distinguished road
Default Ajax Form Help (validation and tips)

Hi Everyone,

I am very new to ajax and still learning. I am a server-side programmer so I ive forgotten most of what I use to know about things related to the client-side. Well, the complex JavaScript related stuff at least. Currently I am trying to teach myself how to get simple things done:

I have a form (that php generates through a class), and I can make it look like anything I please. Now I want to add client side validation process to it. For example:

if event = onKeyUp (for any input field) THEN
ACTION = check for validation (e.g. validate.php)

(my php scripts can take care of validation, and return a message if there is an error or nothing at all if none. I want ajax to send the field contents that the user just entered to the validate script onKeyUP)

if error THEN display a baloon tip *pop* and disable the submit button.

Then the user must correct the input and try again!

What do you guys think? I know there are frameworks that can help me to accomplish this very easily, but since im trying to learn I was wondering if someone here could push me in the right direction (to a tutorial or example code). I've done a bit of research, but still trying to get the hang of it.

Thanks a lot in advance!

Antony

EDIT: actually i think i should chance that onKeyUp to onChange right? The reason for this seems obvious.

Last edited by antonypeiris; 02-11-2008 at 04:16 PM. Reason: writoe something silly, and needed to correct myself
Reply With Quote

Sponsored Links