Board Logo

forcing selection of the calendar text field with javascript
adam_lipscombe - 5/16/2006 at 10:49 AM

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 - 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 - 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 - 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.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/