Re: AJAX button to check if user name exists in database
did answer this I think : http://groups.google.com/group/cake-php/browse_thread/thread/d5feac724840577a/59c150cefb0b1721#59c150cefb0b1721 On Jun 14, 2:31 pm, "jenson" <[EMAIL PROTECTED]> wrote: > Hi friends , > i need to display the alert msg using ajax prototype.when i click > submit button it check if user name exists in database and return alert msg > if username already exists.How to implement that in cakephp ,ihave tried > using php style callling js but while i passed url in the js like this > controllername/functionname its not focused to the function which is written > in controller. > how to implement a ajax this type of validation kindly help me . > > with regards , > jenson. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AJAX button to check if user name exists in database
Hi friends , i need to display the alert msg using ajax prototype.when i click submit button it check if user name exists in database and return alert msg if username already exists.How to implement that in cakephp ,ihave tried using php style callling js but while i passed url in the js like this controllername/functionname its not focused to the function which is written in controller. how to implement a ajax this type of validation kindly help me . with regards , jenson. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AJAX button to check if user name exists in database.
I guess what you have to do is to make an ajax call to your controller that will check in the DB and render a view. This view will update the "availabity" div. You can make an ajaxlink (in a button form) and send the fields (user etc) using the option 'with'. If you have a form for entering your user name already there you can send the form (using it's Id) to the controller check function. In your controller you check if the name exists and set a message using $this->set('message', 'ok'); your rendering view should look like this : $ajax->div('Availability); echo ''.$message.''; $ajax->dviEnd('availability'); Hope this helps On Jun 14, 10:58 am, Unite <[EMAIL PROTECTED]> wrote: > Hi. Im new to PHP and Cake PHP but a fast learner and learn by > example. > > Heres the scenario. > I am making a sign in system with the option to register. > Everything is working 100% on both the sign in and register part. What > I would like to do is add a button on the register page that when > clicked displays a message if the user name exists or is available in > a div tag. > > My current framework > > Model : models/user.php > class User extends AppModel { > var $name = 'User';} > > ?> > > Controller : controllers/users_controller.php > // minus code > class UsersController extends AppController { > function login() { } > function logout() { } > function register() { } > > } > > View : views/users/register.thtml > // Random HTML > > insert button 'Check' > > So now how would I get that div to update when I press the button? > Any help would be really appreciated. > Thanks > Wade --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AJAX button to check if user name exists in database.
Hi. Im new to PHP and Cake PHP but a fast learner and learn by example. Heres the scenario. I am making a sign in system with the option to register. Everything is working 100% on both the sign in and register part. What I would like to do is add a button on the register page that when clicked displays a message if the user name exists or is available in a div tag. My current framework Model : models/user.php Controller : controllers/users_controller.php // minus code So now how would I get that div to update when I press the button? Any help would be really appreciated. Thanks Wade --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---