Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Where am I in the form?

    Is there a way to tell which form element has focus?

    Or is there just a way to tell where a user is at in a form.

    I'm trying to incorporate some keyboard shortcuts in a form.

    There is one area with a list of 25 optional text fields.
    I'd like the user to be able to use the ALT key to just to the next required field if they chose not to fill in the optional ones.

    Any ideas?

    THX

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try something like:

    <input type="textbox" onfocus="focuselement=this.name" name="box1">

    then the variable focuselement tells you which element has focus.

    You can also use:

    this.form.name

    if you need to know the name of the form.
    Last edited by x_goose_x; 08-06-2002 at 05:54 AM.

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks x_goose_x,

    I'm really looking to extrapolate the code from the elements.

    In that scenario I'd have to add the onfocus to every element in the form in order to tell where a user was at. Otherwise where ever a user left the var would be that last element. What it really boils down to is that I don't want to clutter the code for only two sections of the form.

    If there is a method of pulling that away from the elements that would be great.

    Seth.


  •  

    Posting Permissions

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