Copy link to clipboard
Copied
I can use following code to set cfinput text and cftextarea a value from my database, but following code fails for html standard components like
<input type="text"> or textarea.
<CFINPUT type="text" name="Mytext" id="idMyText" value="#mySP.MyValue#" />
Are there any way to set value from database for standard controls?
Your help and information is great appreciated,
regards,
Iccsi,
@Iccsi,
You didn't give much of an explanation of "following code fails", so we're shooting in the dark here. First thought though is: did you wrap the HTML form or input tag with a <cfoutput> tag? The <cfform> tag includes the functionality of <cfoutput> already, which might be why your <cfinput> code works but <input> doesn't.
Rule of thumb when trying to output ColdFusion variable values to the page: if you aren't inside a ColdFusion tag designed to output data to the page (like CFFORM, CFMAI
...Copy link to clipboard
Copied
@Iccsi,
You didn't give much of an explanation of "following code fails", so we're shooting in the dark here. First thought though is: did you wrap the HTML form or input tag with a <cfoutput> tag? The <cfform> tag includes the functionality of <cfoutput> already, which might be why your <cfinput> code works but <input> doesn't.
Rule of thumb when trying to output ColdFusion variable values to the page: if you aren't inside a ColdFusion tag designed to output data to the page (like CFFORM, CFMAIL, etc.), you need to have an enclosing <cfoutput> tag somewhere.
-Carl V.
Copy link to clipboard
Copied
Thanks a million for the information and help,
Regards,
Iccsi,
Copy link to clipboard
Copied
iccsi wrote:
... but following code fails for html standard components like
<input type="text"> or textarea.
<CFINPUT type="text" name="Mytext" id="idMyText" value="#mySP.MyValue#" />
Strictly speaking, the code doesn't fail. It simply stores the string "#mySP.MyValue#" as the value of form.Mytext.