Skip to main content
Inspiring
July 8, 2008
Question

Using cfif in input fields

  • July 8, 2008
  • 2 replies
  • 893 views
I know rest buttons are useless, but my customer wants one, so here I am. I have a form, and the text input and radio buttons have cfif statement to check for values. It all works well. But, by putting cfif in the input fields, the Reset button will not work. If I take the cfif statements out, the Reset button works fine. Just not with the cfif statements. Is there any way around this?

My code is:
<input type="radio" name="first_rate_calc" value="0" onfocus="CLEARFORM()" <cfif isDefined('form.first_rate_calc')><cfif form.first_rate_calc EQ 0>checked="true"</cfif></cfif> />

and

<input name="current_multiplier" type="text" id="current_multiplier" size="5" maxlength="5" <cfif isDefined('form.current_multiplier')><cfif form.current_multiplier NEQ "">Value=
"<cfoutput>#form.current_multiplier#</cfoutput>"</cfif></cfif> />
    This topic has been closed for replies.

    2 replies

    Inspiring
    July 8, 2008
    For my own curiousity, where is the form scope coming from in your cfif tags?
    Inspiring
    July 8, 2008
    DaSpaz wrote:

    Define 'Does not work'?

    Other then some horable tag nesting going on there, I do not see any
    obvious reason why your code would not work with the 'reset' HTML control.

    Clicking on the reset button should return any changed values in the
    form to the original value when the form was first rendered by the
    client browser.