Skip to main content
July 8, 2007
Question

changing the size of text input field in xml style coldfusion forms

  • July 8, 2007
  • 1 reply
  • 947 views
Does anyone know how to get the size attribute of a text input field to work in a coldfusion xml form?

Example: When I enter the following code and view the form in a browser, all of the fields are the exact same size.

<cfform format="xml" name="testingform" method="post">
<cfformgroup type="horizontal">
<cfinput type="text" name="first_name" size="10" label="First Name">
<cfinput type="text" name="middle_init" size="2" label="Middle Initial">
<cfinput type="text" name="last_name" size="20" label="Last Name">
</cfformgroup>
</cfform>
    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    July 8, 2007
    Indeed a mistake in the Coldfusion engine. Or is there some reason for it? In any case, you should report it.

    Look in the source, and you will see why it happens. The XML form makes use of the stylesheet /CFIDE/scripts/css/default_style.css. There the width attribute is hard-coded for the cfinput element, thus

    .cfInput, .cfTextarea {
    font-size: .8em;
    font-family: inherit;
    width: 200px;
    }

    I would replace that block with

    .cfInput {
    font-size: .8em;
    font-family: inherit;
    }
    .cfTextarea {
    font-size: .8em;
    font-family: inherit;
    width: 200px;
    }