SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting prompt at field

    is there a way to have this field with focus (and cursor), when window opens?

    TiA

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,493
    Mentioned
    164 Post(s)
    Tagged
    1 Thread(s)

    tabindex ?

    Maybe you can simply give it a tabindex of 1 ??
    If that doesn't work, a javascript onload - focus should do it for js enabled users.

  3. #3
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your reply

    using tabs i dont know how, but i tried onLoad() but my html has no form so to speak
    take a look, pls:
    HTML Code:
    <body OnLoad="document.username.focus();">
    <div align="center"><span class="data">avulsas</span></div>
    <div class="login">
    <table width="400" border="0" cellpadding="2" cellspacing="2">
    <tr>
    <td width="100" align="right" valign="middle"></td>
    <td width="146"><span id="aviso">&nbsp;</span></td>
    </tr>
    <tr>
    <td width="100" align="right" valign="middle">Nome</td>
    <td width="146"><input id="username" type="text" name="username" /></td>
    </tr>
    <tr>
    <td width="100" align="right" valign="middle">Palavra passe</td>
    <td width="146"><input id="password" type="password" name="password" /></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td width="146"><input type="submit" name="submit" value="Entrar" onclick="CheckLogin()"/></td>
    </tr>
    </table>
    i get a js error msg (of course)
    how can i do it?

    TiA

  4. #4
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    never mind: i added <form name="bla"> and it works
    thanks a lot


Bookmarks

Posting Permissions

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