Hi All,

I want to send the post data to a javascript function. I have put the
code below . Please help name

view.ctp
If I am just calling the js function it works.

.....................
function  validate()    {
             window.alert("It's working");
}

<?php echo $form->create('User', array('action' =>'login'));
 echo $form->input(username);
echo $form-
>submit('signin.gif',array('width'=>100,'height'=>22,'onclick'=>'validate()'));
 echo $form->end();
 ?>

But when I am trying to do like the following it wont work

        function validate()
        {
             var username=document.User.username.value;
             window.alert("username");
        }

<?php echo $form->create('User', array('action' =>'login'));
  echo $form->input(username);
echo $form->submit('signin.gif',array('width'=>100,
'height'=>22,'onclick'=>'validate()'));
echo $form->end(); ?>


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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

Reply via email to