focus my edit box when page loads

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David

    focus my edit box when page loads

    How can I (in PHP) have my first edit box focused and ready for keyboard
    input when the page loads
    (yes, I am new to php :-D )


  • johnmark@fastermail.com

    #2
    Re: focus my edit box when page loads

    PHP is a server side language. You need to do this with a client side
    language like JavaScript.

    David wrote:[color=blue]
    > How can I (in PHP) have my first edit box focused and ready for[/color]
    keyboard[color=blue]
    > input when the page loads
    > (yes, I am new to php :-D )[/color]

    Comment

    • Mark

      #3
      Re: focus my edit box when page loads

      David wrote:
      [color=blue]
      > How can I (in PHP) have my first edit box focused and ready for keyboard
      > input when the page loads
      > (yes, I am new to php :-D )[/color]

      Nothing to do with PHP ...

      It's typically done via client-side script, as follows:


      Somewhere in the <head> add:

      <script
      <!--
      function focus_on_start( )
      {
      document.NAMED_ FORM.NAMED_TEXT BOX.focus();
      }

      <body .... onLoad=focus_on _start()>
      ....
      ...
      <form name='NAMED_FOR M'...>
      <input size='50' name='NAMED_TEX TBOX'...>
      ....
      ...
      ...
      etc.

      And that should do it. won't work on systems with script disabled. There
      is no way around that.


      good ruck!
      mark.



      --
      I am not an ANGRY man. Remove the rage from my email to reply.

      Comment

      • David

        #4
        Re: focus my edit box when page loads

        thanks!

        "Mark" <mw@ANGRYLanfea r.com> wrote in message
        news:POSdnbTjJN H8xivcRVn-oA@nventure.com ...[color=blue]
        > David wrote:
        >[color=green]
        > > How can I (in PHP) have my first edit box focused and ready for keyboard
        > > input when the page loads
        > > (yes, I am new to php :-D )[/color]
        >
        > Nothing to do with PHP ...
        >
        > It's typically done via client-side script, as follows:
        >[/color]


        Comment

        Working...