Skip to main content
Inspiring
September 11, 2008
Question

hidden cfinput with mask

  • September 11, 2008
  • 2 replies
  • 520 views
I have a cfform type ='html' with a cfinput field with type='text'. If I apply a mask like mask='XXXX-XX-XXX-XXXX' it works fine if the field is initially visible, but if the style display: none is set as it is in my case, the mask attribute throws an error because CF8.01 (at least) applies default focus to fields with mask. Anyone have a workaround?
    This topic has been closed for replies.

    2 replies

    Inspiring
    September 11, 2008
    It works fine in FF3.01, but fails in IE 7.0. Adding a setfocus to another
    control has no effect. Even using a minimalist approach demonstrates this:

    <cfform>
    <cfinput type="text" name="test1">
    <div style="display: none">
    <cfinput type="Text" name="test" mask="XXXX-XX-XXX-XXXX">
    </div>
    </cfform>

    BrianOAuthor
    Inspiring
    September 11, 2008
    It works fine in FF3.01, but fails in IE 7.0. Adding a setfocus to another control has no effect. Even using a minimalist approach demonstrates this:

    <cfform>
    <cfinput type="text" name="test1">
    <div style="display: none">
    <cfinput type="Text" name="test" mask="XXXX-XX-XXX-XXXX">
    </div>
    </cfform>