Or, according to PHP faq ( http://tw.php.net/faq.html ) ~
1. Give a name to your form
$form->create('Customer', array('action' => 'login', 'name' =>
'LoginForm'));
2. Catch the form element in another style
document.LoginForm.elements['data[Customer][email_address]'].focus();
---
kiang
On 1月22日, 下午1時00分, dizz <[EMAIL PROTECTED]> wrote:
> Just add an ID to the form input:
>
> <?=$form->input('title', array('id' => 'title'))?>
>
> Then in the JS you can do:
>
> document.getElementById('title').focus();
>
> On Jan 22, 5:52 am, Carl <[EMAIL PROTECTED]> wrote:
>
> > I used to do this with something like this:
>
> > <script
> > type='text/javascript'>document.post_form.title.focus();</
> > script>
>
> > but CakePHP forms use dot notation in the field names.
>
> > I haven't found anything in the existing documentation.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---