I need some help related to AJAX helper. What I am trying to do is
validate a username field to check whether the Username already exists
in the Database. Trying to do this onblur event of the text field.
OnBlur of the text field a AJAX request fires and in response I get a
message saying "Username already exist"/"Username is available". I
need to send the entered username over to the controllers method via
the AJAX request. But I am not able to do so.. Please suggest how to
send the value of the Input field over to the controller action via
Ajax. My code lies below,
$remoteFunction = $ajax->remoteFunction(
array(
'url' => array( 'controller' => 'users', 'action' => 'view',
1 ),
'update' => 'post',
)
);
echo $form->create();
echo $form->input('username', array('label' => false, 'onblur' =>
$remoteFunction ));
echo $form->end();
Please revert back as soon as possible
Thank you
No comments:
Post a Comment