Author Topic: validation without a postback?  (Read 1431 times)

0 Members and 1 Guest are viewing this topic.

Offline liormTopic starter

  • Irregular
  • Posts: 2
    • View Profile
validation without a postback?
« on: September 11, 2008, 05:17:05 PM »
Hi

I wonder how one can do validation without postback, in PHP. In .NET, ill-validated fields are showing an error on the client browser, using javascript, without any post back (except if it's a custom validator) .

Specifically, I'm using Zend. is there a way to do it here? (I mean, using some unified approach, and not by just having included javascript functions customized to every page).

any other framework that does it? code samples?

thanks so much for _any_ idea
Lior
http://www.lgorithms.com
« Last Edit: September 11, 2008, 05:19:14 PM by liorm »

Offline 448191

  • Staff Alumni
  • Fanatic
  • *
  • Posts: 3,506
  • Gender: Male
    • View Profile
Re: validation without a postback?
« Reply #1 on: September 11, 2008, 05:27:19 PM »
There is (AFAIK) no included mechanism in ZF as of current. But, I wouldn't be hard to implement. Just add a custom decorator that triggers an ajax call instead of a post.

Offline liormTopic starter

  • Irregular
  • Posts: 2
    • View Profile
Re: validation without a postback?
« Reply #2 on: September 12, 2008, 10:14:40 AM »
thanks. actually, i'm looking for something simple based on javascript (that's how its done in .net). no need to use Ajax to talk to the server - there are many types of validation that can be done just on the client. for example, a required field

any ideas there?

thanks again
Lior

Offline 448191

  • Staff Alumni
  • Fanatic
  • *
  • Posts: 3,506
  • Gender: Male
    • View Profile
Re: validation without a postback?
« Reply #3 on: September 12, 2008, 10:17:51 AM »
Well yeah, but it's more work: write JavaScript equivalents of the validations in ZF, then, again, use custom decorators to require client side validation before posting.

It's not rocket science, but it is work.