Woohooo!

It worked!

I did a little mockup of a form and setup the client-side
validation, then the server-side validation.

I ran client-side validation on 4 of 5 formfields, but left
one to be validated only server-side.

Sure enough, the 4 client-side fields showed their errors
and once they were all corrected, the server-side error
showed up!

The only drawback to what I've got working now is that
for the server-side validation, the form is posting back
to the page it's on.  That's refreshing the page.

This is where my knowledge breaks down about JS and Ajax.

Can Ajax be used if JS is disabled?

What I'd like to do is have the server-side validation
performed via Ajax to a .cfm processing page so that the
form page doesn't have to be refreshed... is that possible?

Rick




-----Original Message-----
From: Josh Nathanson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 18, 2007 4:38 PM
To: CF-Talk
Subject: Re: Client-side validation or Server-side Validation?

> Is it accurate to say that once the submit button is clicked, Jorn's 
> plug-in
> validates everything server-side first based on the id of the form,
> then once that's complete, with no errors, the form will be submitted to 
> the
> action page automatically, in this case ex2_process.cfm, and perform the
> server-side
> validation?

Hi Rick, I think you meant to say "client-side" when mentioning Jorn's 
plug-in, but you've got the flow correct.

The mechanism is the submit action of the button.  But if you have a client 
side plugin working that is attached to the submit button, it will perform 
the client-side validation BEFORE the form is submitted to the server.  If 
there is no client side event handling attached to the submit button, or to 
the "onSubmit" event of the form, it will go straight to the server.

Glad to see you're making some headway!

-- Josh


----- Original Message ----- 
From: "Rick Faircloth" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Wednesday, April 18, 2007 1:26 PM
Subject: RE: Client-side validation or Server-side Validation?


> Dan...
>
> Something I'm trying to figure out.
>
> What is the mechanism that moves the validation from client-side
> to server-side?  In other words, what causes the server-side validation
> to begin?
>
> Concerning this code:
>
> <form action="ex2_process.cfm" method="post" id="frmMailingList">
>
> Is it accurate to say that once the submit button is clicked, Jorn's 
> plug-in
> validates everything server-side first based on the id of the form,
> then once that's complete, with no errors, the form will be submitted to 
> the
> action page automatically, in this case ex2_process.cfm, and perform the
> server-side
> validation?
>
> I'm not quite sure of the flow of activity.
>
> Rick
>
> -----Original Message-----
> From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 18, 2007 1:58 PM
> To: CF-Talk
> Subject: RE: Client-side validation or Server-side Validation?
>
> Rick,
>
>>If it's client-side placing the message, it places by the id, e.g.
>>"id=errorMessage".
>>If it's server-side placing the message, you use a CFIF statement to
>>determine
>>that and place the error message in the same div via cfoutput.
>>
>>Correct to this point?
>
> Yes, if you look at my code, I've correctly formatted the <label /> tag 
> for
> Joern's plug-in.
>
> However, I think he was thinking about getting away from using the <label 
> />
> tag and was going to make some other changes, so I can't say the technique
> in that example page will always work.
>
> However, you can use Firebug in Firefox to inspect the DOM element that's
> automatically generated by Joern's plugin to get the correct syntax.
>
> -Dan
>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275778
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to