|
||||||
| AJAX Web based language that allows asynchronous loading of pages that does not interfere with normal page loading. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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 |
| Sponsored Links |
|
|
|
|||||
|
I see its been awhile since this post...did you ever figure anything out? What you want to accomplish is definitely doable...but I'd be careful using ajax with an onKeyUp event...that means that every time the user presses a key you're going to hit your server again...that is probably going to be excessive. What I would recommend is using Prototype.js. Take a look at the documentation on that web site. I'd check out Ajax.PeriodicalUpdater here. That would probably work better than going after an onKeyUp event.
Good Luck!
__________________
Visit My Google Group Here: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
|
|||
|
Hi,
Thank you so much for the advice, I appreciate it. I completely agree with you about the onKeyUp event (in fact, you might have missed the "EDIT" I put in there just after I posted my message, cos I realized it would mean too many requests to the server) ... as for a solution, well I didn't find exactly what I was looking for, but I designed a little js script myself based on what ive gathered from a various tutorials and implemented a way that would pop up a little message right below the field after an onChange event. This way it only validates it when the user has finished typing and moved the cursor to a new field. The only problem so far is that the last field in the form dosent get much attention since its usually the submit button after that. Know what I mean? I didn't figure out how to disable the submit button.. lol actually i forgot all about that, I just remembered after reading what I wrote. I've heard of prototype, I will certainly give it a try. It is sort of an ajax frame work isnt it? Maybe I can look at the code and see if I can figure out how it works from the inside. Thanks again for the tip. By the way, have you heard of ext.js ? It is also a framework, but it seems very bloated... have you ever tried it? Thanks again and take care ![]() |
|
|||
|
thank you again, for these excellent tips! You made me realize several important factors that I hadn't considered before. Also, I will try to apply the advice you suggested to for my problem. I greatly appreciate the help
![]() |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
| Xav | ........ | 1097.16 |
| MeTh0Dz|Reb0rn | ........ | 986.37 |
| morefood2001 | ........ | 850.04 |
| John | ........ | 841.93 |
| WingedPanther | ........ | 684.54 |
| marwex89 | ........ | 638.26 |
| Brandon W | ........ | 493.36 |
| chili5 | ........ | 292.12 |
| Steve.L | ........ | 188.37 |
| orjan | ........ | 187.41 |
Goal: 100,000 Posts
Complete: 79%