Home
Saturday, April 29, 2017
4:07:22 AM
Users online: 0   You are here >> Home > Web Design

Forums | Web Design Forums search
Forum FAQ
   
  1 | 2 Next Page 
Learning Ajax
superfireydave 
23/5/08 4:54:18 AM
Titan

Hi all,

I'm wondering if someone could point me in the way of some really quick and easy ajax validation tutes?

Basically, I have an email and password field, and I'd like to make sure both have values, and that the email is a valid email address before posting the data to PHP. I've had a look, and the tutes I've found have all used frameworks (can't use) or PHP to validate as well (as in, the validation with ajax has appeared to be linked to PHP, not that it validates in ajax first, then is also validated in PHP).

It's part of an assignment so I'd appreciate you not posting an answer, but any help is appreciated =P

-----
Mreow?
Quote by DEVERE
Juts a bltto;e of ba9leys fior me.. no persicptiom meds



nickeax 
23/5/08 9:26:51 AM
Banned

http://www.w3schools.com/ajax/default.asp is pretty much all you need to know for validation.

-----
"Words are the rails upon which the train of thought runs."

Girvo 
23/5/08 11:00:54 AM
Immortal

Its just straight Javascript, no? Should be easy, getElementById is your friend.

-----
[No Heroes] is the artistic antithesis of that sinking world; a thorn in the side of their beast. It's for those who move mountains one day at a time. It's for those who truly understand sacrifice. In our world of enemies, we will walk alone...

superfireydave 
23/5/08 12:50:26 PM
Titan

Ah cheers, didn't even think about the w3schools. I'll give it a look after I've had some sleep :D

-----
Mreow?
Quote by DEVERE
Juts a bltto;e of ba9leys fior me.. no persicptiom meds



nicephotog-jvm.net 
23/5/08 9:51:43 PM
Master

AJAX is only a tiny section of javascript and jscript.
It primarily is simply the connection function "object" in either
MSXML's scripting support or the w3c.org XMLHTTPRequest() "object".

It is the connection between a processing script URL (CGI) and embedded
in the page controlled by a new special "readystatechange" event, not
unalike that for Image() object pre-loading.

If you want to validate something, learn "client side javascript" and
"DHTML".
Unfortunately again, to get the full ability from AJAX, you must also
learn w3c.org DOM levels 1 2 and 3 , and again , the MS javascript/DHTML
dialect equivalents.

-----
NIN - Reptile (Reciprocating Marine engine)

superfireydave 
23/5/08 10:37:08 PM
Titan

I want to learn Ajax specifically for an assignment.

If you can't understand what I'm asking, kindly stay out of my threads.

-----
Mreow?
Quote by DEVERE
Juts a bltto;e of ba9leys fior me.. no persicptiom meds



johnsee 
24/5/08 12:33:33 PM
Mod
SuperHero

Immortal


I use this:

http://www.tetlaw.id.au/view/javascript/really-easy-field-validation

It. Fucking. Rocks.

-----
Quote by Mac Dude
I love the smell of napalm in the Green Room.
------

superfireydave 
24/5/08 2:30:08 PM
Titan

Yeah, that's what I use in my professional capacity - but for Uni I have to write my own, and I've never really had to do that before =P~

-----
Mreow?
http://www.atomicmpc.com.au/forums.asp?s=2&c=9&t=17306

johnsee 
25/5/08 2:34:11 PM
Mod
SuperHero

Immortal


nicephoto does have a point.

For it to be using true ajax functionalilty, it might be validating against a value on the server or something different without the page refreshing.

Most validation is just javascript, even if it does have fancy scriptaculous effects or similar

-----
Quote by Mac Dude
I love the smell of napalm in the Green Room.
------

Girvo 
25/5/08 8:48:47 PM
Immortal

Quote by superfireydave
Yeah, that's what I use in my professional capacity - but for Uni I have to write my own, and I've never really had to do that before =P~



1) Find how getElementById works.
2) Apply some basic JS to your page
3) ???
4) PROFIT!!!!


:P

Nicephoto was actually right. What you're doing isn't AJAX per se.

-----
[No Heroes] is the artistic antithesis of that sinking world; a thorn in the side of their beast. It's for those who move mountains one day at a time. It's for those who truly understand sacrifice. In our world of enemies, we will walk alone...

superfireydave 
25/5/08 10:07:54 PM
Titan

Quote by Girvo
What you're doing isn't AJAX per se.


Pretty sure what I need to do is :) but thanks anyway.

-----
Mreow?
http://www.atomicmpc.com.au/forums.asp?s=2&c=9&t=17306

luser 
27/5/08 8:34:37 PM
Overlord

Quote by superfireydave
the tutes I've found have all used frameworks (can't use) or PHP to validate as well (as in, the validation with ajax has appeared to be linked to PHP, not that it validates in ajax first, then is also validated in PHP)



Right, because AJAX is a way of asynchronously calling server-side code, then updating the client based on the response. If you were to do form validation using AJAX you would still be doing server-side validation. This is not the point of using JavaScript for client-side validation and is not the point of AJAX.

Quote by superfireydave
Quote by Girvo
What you're doing isn't AJAX per se.


Pretty sure what I need to do is :) but thanks anyway.



Unless you're talking about something you haven't mentioned in this thread, I'm 100% sure it isn't. Stop ignoring everyone and insisting you need to use AJAX when you really really don't. nicephotog-jvm.net's post was completely valid and is exactly what you need to hear but you dismissed it altogether.

-----
It's gonna be a glorious day!
I feel my luck could change.

GTAV6 
27/5/08 9:07:16 PM
Hero
Titan


um... there might be a very small something you've missed in this thread, luser - the frequent use of 'smiley faces'.

so, i don't know the first thing about ajax (i though it was a kitchen cleaning product, actually). hence, yes, nicephotog probably is valid in this instance, but given that he's often been difficult to understand in the past, it's reasonable that dave may have dismissed his comments - however, i don't for a moment imagine dave is ignoring everyone, as that's not something he normally does in here.
perhaps it might've been nicer to not be just quite so blunt?

:o)

-----

+++ out of cheese error +++ melon melon melon +++ redo from start +++

- - - - - - - - - - - - - - - - - - - - -
http://www.thexman.net.nz/

superfireydave 
27/5/08 9:33:36 PM
Titan

Quote by luser
Unless you're talking about something you haven't mentioned in this thread, I'm 100% sure it isn't. Stop ignoring everyone and insisting you need to use AJAX when you really really don't. nicephotog-jvm.net's post was completely valid and is exactly what you need to hear but you dismissed it altogether.


Well, the assignments already been handed in but the reason for my dismissing of posts is that I did need to use Ajax, not JS (which is what I ended up implementing anyway as I know JS and I didn't have time to implement the Ajax in the way I was going to) and was specifically asking for information related to learning Ajax (which is something I've never done before :<).

I was a little ambiguous in my first post, so it's partly my fault too - and I'm sorry for that.

-----
Mreow?
http://www.atomicmpc.com.au/forums.asp?s=2&c=9&t=17306

Girvo 
27/5/08 9:42:58 PM
Immortal

You should be. No more lollies for you.

-----
Quote by Kothos
I look like a malting Yeti.



superfireydave 
27/5/08 9:44:00 PM
Titan

Quote by Girvo
You should be. No more lollies for you.


I think I can safely speak for myself when I say I HOPE YOU DIE IN A FIRE.
edit: Oh, and I hate FMS 2.0


Edited by superfireydave: 27/5/2008 9:44:17 PM

-----
Mreow?
http://www.atomicmpc.com.au/forums.asp?s=2&c=9&t=17306

luser 
27/5/08 10:03:06 PM
Overlord

Quote by GTAV6
perhaps it might've been nicer to not be just quite so blunt?



That's just how I am. I'm not being rude, I'm actually meaning to be helpful. IMO if Dave read what everyone had been saying with an open mind he'd have a much better understanding of the problem. Which is the reason for asking questions right?

Quote by superfireydave
Well, the assignments already been handed in but the reason for my dismissing of posts is that I did need to use Ajax, not JS (which is what I ended up implementing anyway as I know JS and I didn't have time to implement the Ajax in the way I was going to) and was specifically asking for information related to learning Ajax (which is something I've never done before :<).

I was a little ambiguous in my first post, so it's partly my fault too - and I'm sorry for that.



Yeah your post was specifically about using AJAX for form validation, hence the misunderstanding. It's a case of trying to match a solution to a problem it isn't intended for, and it would have been counter-productive to go along with it.

AJAX solves one problem - the need for the client to download an entire page when only a small section of it is dynamically generated.

Client-side validation solves another problem - it avoids making a round-trip to the server just to be told you haven't filled in the form correctly.

Using AJAX to make an HTTP request defeats the purpose of having client-side validation - you're getting the server to validate it anyway!

-----
It's gonna be a glorious day!
I feel my luck could change.

superfireydave 
27/5/08 10:17:21 PM
Titan

Quote by luser
Yeah your post was specifically about using AJAX for form validation, hence the misunderstanding. It's a case of trying to match a solution to a problem it isn't intended for, and it would have been counter-productive to go along with it.

AJAX solves one problem - the need for the client to download an entire page when only a small section of it is dynamically generated.

Client-side validation solves another problem - it avoids making a round-trip to the server just to be told you haven't filled in the form correctly.

Using AJAX to make an HTTP request defeats the purpose of having client-side validation - you're getting the server to validate it anyway!

Yeah, I realise it's not the best way to do it, but unfortunately I don't make the criteria for my assignments =P (the content for this course changed this year too, so perhaps they're still ironing out some bugs).

-----
Mreow?
http://www.atomicmpc.com.au/forums.asp?s=2&c=9&t=17306

nicephotog-jvm.net 
9/6/08 8:32:10 PM
Master

There is no dispute on re-vilative of traitors and complete fools.
Learn physics, maths and common sense
RES IPSA DES!
Quid Pro Quo?

Learn javascript,Objective C,ECMA262,MicrosoftJscript for MSXML, and DOM 1,2,3,w3c.org , CORBA-IDL, or your completely "........................"
With a broken bottle neck up the "...........................".
And learn some respect.


Edited by nicephotog-jvm.net: 9/6/2008 9:05:46 PM

-----
NIN - Reptile (Reciprocating Marine engine)

Girvo 
10/6/08 5:41:41 PM
Immortal

You know, that post almost made sense.






Almost.

-----
Quote by s.o.u.p!
I pull out my 27" telescopic baton and wave it menacingly at possums sometimes because I'm lonely and lame.




Euphemism?
  1 | 2  | Next Page 
Forums | Web Design