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:

On Sun, Sep 20, 2009 at 9:47 AM, MEM <> 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,
> >

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to