Never rely on client side validation, that's for convenience for your users,
not security.First, make the functionality works (including security)
without javascript.
Then override the submit button with javascript by observing the submit.  In
that event code you submit the form via ajax, hide the div, display what you
want, etc. then use event.stop to keep the default submit behavior
from occurring.
Good luck with this.

Some links:
http://api.prototypejs.org/dom/event.html#stop-class_method
<http://api.prototypejs.org/dom/event.html#stop-class_method>
http://api.prototypejs.org/dom/document.html#observe-class_method
<http://api.prototypejs.org/dom/element.html#update-class_method>and
http://api.prototypejs.org/ajax/ajax/updater.html

On Sun, Sep 20, 2009 at 9:47 AM, MEM <tal...@gmail.com> wrote:

>
> Hello all,
>
> I'd love to create a contact form using prototype and php.
> However, I want to make sure that, if the javascript is disable,
> the submission should be server side validated and submitted as well.
>
> If javascript is enable, the onclick event will trigger, hence, the js
> validation
> Will occur.
> If the javascript isn't enable, the onclick event will not trigger,
> so the submit button will get called, and the server side validation will
> occur.
>
> I don't know if it's precise, however, it works.
>
>
> Now what I'd like to do is, without leaving the same page,
> when the form is submitted, the div that contains the form gets hidden, and
> it should
> be replaced by a div telling: "The contact was send".
>
> I'm so newbie, that I've found a validation class called:
> "Really easy field validation with Prototype" and it seems to be very nice.
>
> Can anyone summarize the steps to accomplish this without losing the server
> side submission if, js
> Is disable somehow?
>
> Should I try to edit (I really don't like this idea) the validation class
> for doing this?
> Or can this be done otherwise?
>
>
> Thanks a lot to any feedback on this,
> Regards,
> MEM
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to