Well using the observe_form helper you can pass the current values of the form to an action to do verification server side and then return a result. Not ideal with the new forms system but I am sure there must be a way (I have not investigated as of yet) to use your existing validation setup in your forms class to pass back a result and so enable the submit button for a form etc.
Personally I feel that the forms framework should include an easier way to do client side validation as more and more web apps are moving away from the submit-entire-page process to accept form input. Before the Web 2.0 "revolution" (for want of a better word) the forms framework would have been fine but the asynchronous requests are now a part and parcel of developing a web app not an oddity or exception. Or at least thats my take. On Thu, Mar 26, 2009 at 8:52 AM, James <thenet...@gmail.com> wrote: > This is one of the things I dislike about the new forms system. There's > gotta be a better way than additional requests to the server for ajax > validation without having to float your own javascript. > > James > > > On Mar 26, 2009, at 2:44 AM, Gareth McCumskey wrote: > > Look at using the observe_form() Ajax Helper ( > http://www.symfony-project.org/book/1_1/11-Ajax-Integration#chapter_11_sub_ajax_driven_forms). > I have succesfully used this. What this means is that you can then use an > action to run validation using the sfValidator classes on the data. > > Gareth > > On Thu, Mar 26, 2009 at 5:11 AM, rafix <rafi...@gmail.com> wrote: > >> >> How can I validate a form field in real time? >> For example , after completing username field, validate if the value >> exists in the table before executing the action. >> >> On 25 mar, 15:00, Paolo Mainardi <paolomaina...@gmail.com> wrote: >> > I don't understand, you want someone that code for you ? What are your >> > problems ? Where are you stuck ? >> > >> > Like i've said before, it's almost all Javascript and for the other >> > follow the documentation, it's not a so hard task. >> > >> > Paolo Mainardi >> > CTO Twinbit >> > >> > Il giorno 25/mar/09, alle ore 19:32, rafix <rafi...@gmail.com> ha >> > scritto: >> > >> > >> > >> > > Hello friends, a few days ago I started working on a project where I >> > > need to create email accounts in the data model is a table mailbox >> > > that contains among others the following fields: username, id_domain, >> > > email >> > > I need to do is: >> > > 1 - enter your username (username) and instantly validate whether the >> > > user exit. >> > > 2 - select a combo of the domain (id_domain)! This is not a >> > > problem! :- >> > > D >> > > 3 - Save in the email address (username @ domain) and to validate an >> > > email address is correct. All thiwithout having to write it. formed >> > > with the username field and the selected domain. >> > >> > > The Symfony version is 1.2... whit admin generator. >> > >> > > Greetings, >> > > Rafix >> >> > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---