Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003

    Unanswered: onload highlight text...

    I have a form page and I have a body onload to automatically set the cursor on field Month...

    I also have in the field Month
    value="<?php echo date('m'); ?>"

    As a result, when the page loads the cursor goes to the month field which has the contents of the current month looks something like that ---> |10

    Anyway, can I make it so the 10 is highlighte so that i can either tab to the next field "
    day which has the value date('d') or i can just type 02 for feburary and the tab to the next field...

    In other words, I want the 10 to be highlighted by default on page load...

    Is there a way to do this?

  2. #2
    Join Date
    Apr 2005
    Baltimore, MD
    The month field is a text field? If so, you can use javascript to call monthTextField.focus() and then Actually, you may not even need to call the focus() javascript is a little lagging.

    Hope that helps some.


  3. #3
    Join Date
    Dec 2003
    Thanks for your reply
    I actually found this:

    I put it right after value="<?php date('d'); ?>"

    It worked perfect!
    Thanks anyway


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts