Highlighted

CFHTMLTOPDF tag does not function correctly with radio groups that have no selected option

New Here ,
Mar 08, 2018

Copy link to clipboard

Copied

I am trying to use the <CFHTMLTOPDF> tag to generate PDF output but radio groups that have no option selected is appearing in the PDF output with the first option selected.  If I wrap the same HTML around the <CFDOCUMENT format="PDF"> tag, the radio group in the PDF output is rendered correctly (no radio buttons are selected in the group).

Is this a bug with the <CFHTMLTOPDF> tag?  Is there any workaround for this issue?

Thanks for your help.

Views

423

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

CFHTMLTOPDF tag does not function correctly with radio groups that have no selected option

New Here ,
Mar 08, 2018

Copy link to clipboard

Copied

I am trying to use the <CFHTMLTOPDF> tag to generate PDF output but radio groups that have no option selected is appearing in the PDF output with the first option selected.  If I wrap the same HTML around the <CFDOCUMENT format="PDF"> tag, the radio group in the PDF output is rendered correctly (no radio buttons are selected in the group).

Is this a bug with the <CFHTMLTOPDF> tag?  Is there any workaround for this issue?

Thanks for your help.

Views

424

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 08, 2018 0
Adobe Community Professional ,
Mar 08, 2018

Copy link to clipboard

Copied

Henry, I’m not aware of any such bug.

But I would always suggest in a case like this that you would really help yourself to create a simple 5-10 line demo of the problem. Sometimes you’ll find out that the problem is not quite as obvious as it seems, as it may go away in the “simple demo”, which means that there’s some relationship that you’re not considering that really causes the problem. Perhaps in identifying that, you identify the issue and then can have others test if they see that same problem.

Along those lines, you should also report exactly what version of CF you’re running (and what update level), as someone else may try it on another release where it works. Finally, you may want to make sure there were no errors in any CF updates you applied. For that last point, see my post:

http://www.carehart.org/blog/client/index.cfm/2016/9/6/solve_common_problems_with_CF_updates_in_10_and_above

Hope that helps.

/charlie

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 08, 2018 0
New Here ,
Mar 09, 2018

Copy link to clipboard

Copied

Thanks for the reply. I am currently using ColdFusion 11.0.13.303668.  Here is the simplified demo that I ran:

<cfhtmltopdf>

     <div>

          <input name="test_radio_group" type="radio" value="Y"> Yes

          <input name="test_radio_group" type="radio" value="N"> No

     </div>

</cfhtmltopdf>

When I ran the above code, the first radio button (i.e. Yes) would be selected.  However, if I run the following code, the PDF output would appear correctly (i.e. no radio buttons are selected):

<cfdocument format="PDF">

     <div>

          <input name="test_radio_group" type="radio" value="Y"> Yes

          <input name="test_radio_group" type="radio" value="N"> No

      </div>

</cfdocument>

Try it out and let me know if you see the same behavior.  Thanks for your help.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2018 0
LEGEND ,
Mar 09, 2018

Copy link to clipboard

Copied

Report this as a bug, I will vote for it.

I tried this on my CF 11.0.0.289974 and it's doing the same thing.

CF10 doesn't recognize CFHTMLTOPDF. 

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2018 0
LEGEND ,
Mar 09, 2018

Copy link to clipboard

Copied

Also, according to this article, you should probably be using CFDOCUMENT type="pdf", anyway. 

https://helpx.adobe.com/coldfusion/kb/differences-cfdocument-cfhtmltopdf.html

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2018 0
Adobe Community Professional ,
Mar 09, 2018

Copy link to clipboard

Copied

Wolf, what are you trying to say? That the page you link to suggests favoring cfdocument over cfhtmlpdf, for the radio button he’s using? (I don’t see that.) Or in general (I don’t see that)?

Or do you mean he should be using type=”pdf” vs the format=”pdf” he’s using? I don’t see that, either. Format is the right attribute, not type.

As for the code, I’m unable at the moment to try it myself. Have entire of you tried it on CF2016?

/charlie

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2018 0
LEGEND ,
Mar 09, 2018

Copy link to clipboard

Copied

Sorry, should have been more concise. 

It is my personal opinion, based upon the differences highlighted in the article, that CFDOCUMENT does more than CFHTMLTOPDF and should be preferred.  That's all I was saying.

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2018 0
New Here ,
Mar 09, 2018

Copy link to clipboard

Copied

I only have access to CF11. If somebody can try it on the latest version of CF and let me know if this bug has been fixed, it would be very appreciated.

Thanks to all for your help with this issue.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2018 0
BKBK LATEST
Adobe Community Professional ,
Mar 09, 2018

Copy link to clipboard

Copied

Hi Henry,

It looks like buggy behaviour. Remember to add the form tag when you report the bug:

<div>

<form>

          <input name="test_radio_group" type="radio" value="Y"> Yes

          <input name="test_radio_group" type="radio" value="N"> No

</form>

</div>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 09, 2018 1