Professional Web Applications Themes

CF INPUT textfield is automatically selected whenusing CF FORM - Macromedia ColdFusion

sorry for repeating this post, I continually got an error from the forum, so I thought it wasn't posting...

Sponsored Links
  1. #1

    Default Re: CF INPUT textfield is automatically selected whenusing CF FORM

    sorry for repeating this post, I continually got an error from the forum, so I thought it wasn't posting
    Sponsored Links
    rainydayclouds Guest

  2. #2

    Default Re: CF INPUT textfield is automatically selected whenusing CF FORM

    You might go back and set those other posts as "answered" -- as a courtesy.

    Anyway, CFFORM adds javascript to automatically focus the first item of your
    form -- especially when masks are used.
    This is normally a very good thing -- and is user friendly.

    There are various ways to get around this. One quick and dirty way is
    attached...


    Add this code at the very bottom of your page -- preferably just before the
    </html> tag...

    <script type="text/javascript">

    // Remove focus from first field in the form. WARNING page-specific code!
    if( doent.getElementById )
    {
    doent.getElementById('firstName').blur();
    }
    if( doent.all )
    {
    doent.all['firstName'].blur();
    }
    </script>

    MikerRoo Guest

  3. #3

    Default Re: CF INPUT textfield is automatically selected whenusing CF FORM

    Doesn't seem to work, and I put it just before the </html> tag.
    Okay I've decided the auto focus on the field is fine.
    What bugs me even more is that the page jumps down to the First Name field as
    if its an anchor.

    rainydayclouds Guest

  4. #4

    Default Re: CF INPUT textfield is automatically selected whenusing CF FORM

    Can you post a link to the updated page (where the dualing JS does not work)?
    Also, what browser are you using?

    Finally, the page will jump down to the First Name field as long as CFforms'
    mask javascript is setting focus to this field.

    There are only three ways around that:
    (1) Eliminate the Mask javascript
    or
    (2) Reset the focus to a higher-up element after the mask JS fires (a tricky
    procedure, as we have seen -- and subject to browser diversity)
    or
    (3) Create a hidden "first" form element, near the top of the page, that will
    receive the initial focus.



    MikerRoo Guest

Similar Threads

  1. passing the value of an input textfield to anothertextfield
    By scottba in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: January 18th, 04:49 PM
  2. textfield is automatically selected in form
    By rainydayclouds in forum Macromedia ColdFusion
    Replies: 0
    Last Post: May 2nd, 05:57 AM
  3. Uppercase() Input textfield
    By Tiago Simões in forum Adobe Flash, Flex & Director
    Replies: 2
    Last Post: January 27th, 12:04 AM
  4. No cursor in input textfield field in NS and Mozilla
    By Andreas Borg webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: January 23rd, 12:20 PM
  5. How to read input from a textfield in a datagrid !?!
    By Remco Groot Beumer in forum ASP.NET Building Controls
    Replies: 3
    Last Post: November 10th, 05:40 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139