Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using cfif in input fields

Explorer ,
Jul 08, 2008 Jul 08, 2008
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> />
840
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 08, 2008 Jul 08, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 08, 2008 Jul 08, 2008
LATEST
For my own curiousity, where is the form scope coming from in your cfif tags?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources