adam_lipscombe
Junior Member
Posts: 4
Registered: 5/3/2005
Location: uk
Member Is Offline
|
| posted on 5/16/2006 at 10:49 AM |
|
|
forcing selection of the calendar text field with javascript
How can I select the calendar text field with javascript?
the normal approach of
document.forms[0].<fieldName>.select();
does not seem to work.
I have version 2.1.15
Version: 2.1.15 (modal mode)
Date: 04/15/2005 (mm/dd/yyyy)
|
|
|
tigra
Administrator
Posts: 1926
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 5/17/2006 at 10:09 AM |
|
|
do you want to move the cursor to the input box? Then you should use .focus() method.
|
|
|
adam_lipscombe
Junior Member
Posts: 4
Registered: 5/3/2005
Location: uk
Member Is Offline
|
| posted on 5/17/2006 at 10:26 AM |
|
|
thanks.
I tried that but it doesnt seem to work either.
What i want to do is to hightlight all the text in the date field so user can type something else.
select() and focus() dont seem to behave as they would do with "normal" text fields.
|
|
|
tigra
Administrator
Posts: 1926
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 5/17/2006 at 10:38 AM |
|
|
the calendar uses the standard <input type="text"> element. You probably run the code before that element is actually created by the calendar.
You can run it later or attach the calendar to static (preexisting) input box.
|
|
|