Coldfusion preFill Form checkbox
Posted on 2014-08-05
I know this is easy, but so far I have not been able to get this to work. All I want to do is preFill a checkbox in a cfform.
on my search page I have this checkbox
<input type="checkbox" name="foreclosure" value="yes">Foreclosure
and when I submit the form to the action page "results" page, I have the same search form there so you can filter results/adjust search query. I want to preFill the checkbox above.
This is what I tried and it doesnt work:
<cfif IsDefined("url.Foreclosure") and len(trim(url.Foreclosure))>
<cfset form.Foreclosure = url.Foreclosure>
<!---form prefill Foreclosure--->
<cfset CLIENT.Foreclosure = Form.Foreclosure>
<cfset prefillForeclosure = Form.Foreclosure>
<cfset prefillForeclosure = CLIENT.lastForeclosure>
<cfset prefillForeclosure = " ">
Can someone tell me where I went wrong?
Thanks! any help is appreciated.