Skip to main content
Inspiring
August 14, 2009
Answered

Reset One field Only in Coldfusion Flash Form

  • August 14, 2009
  • 1 reply
  • 1537 views

I have a flash form with a fair amount date fields.  I use the code

<cfinput type="datefield" name="DATE1" label="Diagnosis Date:" width="100" value="#now()#"/>

This is the master date field. It populates about 10 other date fields by using the following code for the other 10 fields.

<cfinput type="datefield" name="DATE2" label="Diagnosis Date:" width="100" bind={DATE1.txt}/>

There are certain cases where date fields 7-10 are not used. Unfortuantely, fields 7-10 in those cases are prepopulated because of the bind. I want to put a reset/clear button besides each of those date fields (7-10). Is there a way to code the reset/clear button to only clear the corresponding date field? Right now, I have the users choosing the same date as DATE1 to clear out the field. That is 2 clilcks. I would prefer the users just to click on a reset/clear button.

TIA!

This topic has been closed for replies.
Correct answer BKBK

Put this in your pipe. Does  it smoke?

<cfform format="flash">
<cfformgroup type="horizontal">
<cfinput type="datefield" name="DATE1" label="Diagnosis Date 1:" width="100" value="#now()#"/>
</cfformgroup>
<cfformgroup type="horizontal">
<cfinput type="datefield" name="DATE2" label="Diagnosis Date 2:" width="100" bind="{DATE1.text}"/>
<cfinput type="button" name="date2button" onclick="{DATE2.text=''}" value="Reset Date 2">
</cfformgroup>
<cfformgroup type="horizontal">
<cfinput type="datefield" name="DATE3" label="Diagnosis Date 3:" width="100" bind="{DATE1.text}"/>
<cfinput type="button" name="date3button" onclick="{DATE3.text=''}" value="Reset Date 3">
</cfformgroup>
</cfform>

1 reply

BKBK
BKBKCorrect answer
Adobe Expert
August 16, 2009

Put this in your pipe. Does  it smoke?

<cfform format="flash">
<cfformgroup type="horizontal">
<cfinput type="datefield" name="DATE1" label="Diagnosis Date 1:" width="100" value="#now()#"/>
</cfformgroup>
<cfformgroup type="horizontal">
<cfinput type="datefield" name="DATE2" label="Diagnosis Date 2:" width="100" bind="{DATE1.text}"/>
<cfinput type="button" name="date2button" onclick="{DATE2.text=''}" value="Reset Date 2">
</cfformgroup>
<cfformgroup type="horizontal">
<cfinput type="datefield" name="DATE3" label="Diagnosis Date 3:" width="100" bind="{DATE1.text}"/>
<cfinput type="button" name="date3button" onclick="{DATE3.text=''}" value="Reset Date 3">
</cfformgroup>
</cfform>

icarus013Author
Inspiring
August 17, 2009

It is smoking really well. Very Smooth!