Re: How do I set focus to a form input field?

2008-01-22 Thread kiang
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日,

How do I set focus to a form input field?

2008-01-21 Thread Carl
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.

Re: How do I set focus to a form input field?

2008-01-21 Thread dizz
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