I don’t understand how to insert a diagram into Calculated Fields Forms using CP Blocks; when adding a diagram, the code appears
<!--BLOCK_ID_74--><script>if(typeof chartjsBlock=='undefined'){chartjsBlock={'queue':[],'loading':false,'formatNumber':function(v){v=(new String(v)).replace(/[^\d\.\-]/g,'');if(!isNaN(v)) return v*1;throw'Not a Number';},'getColor':function(i){var COLORS=['#4dc9f6','#f67019','#f53794','#537bc4','#acc236','#166a8f','#00a950','#58595b','#8549ba'];return COLORS[i%COLORS.length];},'clear':function(id){var e=jQuery('#'+id),n=jQuery('<canvas></canvas>');n.attr('id',id).width(e.width()).height(e.height());e.replaceWith(n);},'callback':function(){while(this.queue.length){var i=this.queue.shift();i['chart'].apply(this,i['args']);}}};} chartjsBlock['pieChart']=function(canvasId,data,config){var me=this,options={responsive:!(document.getElementById(canvasId).offsetParent===null),animation:false,plugins:{legend:{display:true},title:{display:true}},cutout:0,},labels=[],values=[],colors=[];me.clear(canvasId);if(typeof config['title']=='string'){options['plugins']['title']['display']=true;options['plugins']['title']['text']=config['title'];delete config['titlel'];} jQuery.extend(true,options,config);if(typeof data==='object'&&typeof data['length']!=='undefined'){for(var i in data){var d=data[i],v;try{if(typeof d==='object'){if(typeof d['value']==='undefined') throw'Data Required';v=me.formatNumber(d.value);values.push(v);labels.push((typeof d['label']!=='undefined')?d.label:'');colors.push((typeof d['color']!=='undefined')?d.color:me.getColor(i));}else{v=me.formatNumber(d);values.push(v);labels.push('');colors.push(me.getColor(i));} if(v<0) options.scales.y.beginAtZero=false;}catch(err){continue;}}} new Chart(document.getElementById(canvasId),{type:'pie',data:{labels:labels,datasets:[{fill:false,data:values,backgroundColor:colors}]},options:options});};window['setPieChartBlock']=function(id,items,config){if(typeof id==='undefined') return;var c=document.getElementById(id);if(!c||c.tagName!=='CANVAS') return;if(typeof config==='undefined') config={};chartjsBlock.queue.push({'chart':chartjsBlock.pieChart,'args':[id,items,config]});if(typeof window['Chart']==='undefined'){if(!chartjsBlock.loading){jQuery.getScript('https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js',function(){chartjsBlock.callback();});} chartjsBlock.loading=true;return;} chartjsBlock.callback();};</script><!--END_BLOCK_ID_74-->
]]>
Hi,
I have just upgrade my WordPress to 5.9.3 and php 8.0. When I active this plugin, it crash my dashboard. Can you help me with this issue? Thank you
]]>hi, i need your help!
I want to print samples according to designs, including structure and colors. Maybe my print button has a problem, it does not print correctly with the form!
hi, i need your help!
My print button works fine on Preview but when posted on the page, it doesn’t work. The preview panel has no content
i hope support!
Hi,I need your help!
I installed CP block for my WP. I want to print all the information in the form using the Print button. I tried many ways, but still failed.You can guide me in pictures, because I’m not good at foreign languages.
Thank you!
Hi
How can I assign onclick to a button when pressed goes to a URL?
Thanks
]]>Hi,
I subscribed to CP-blocks plugin after reading a few times in the forums you mentioning that it is an easy solution to get a chart populated by Calculated Fields Form. Apparently, it is not as easy as I expected, so I was wondering if you can help.
Currently I have bar chart which get values from calculated fields, but it doesn’t update once I change the values.
What I lack is probably a single line of code which would force bar chart to react to any change.
My code is:
<canvas id="canvas1"></canvas>
<Script>
fbuilderjQuery(document).one('showHideDepEvent', function(){
var result = fbuilderjQuery('[id*="fieldname10_"]').val();
var national = fbuilderjQuery('[id*="fieldname2_"]').val()*fbuilderjQuery('[id*="fieldname11_"]').val()*0.5*52;
setBarChartBlock('canvas1', [{label: 'Title 1', value: result, color: '#FEBF18'},{label: 'Title 2', value: national, color: '#222222'}]);
});
</script>
Thanks in advance!
]]>I installed the CP BLOCKS plugin, as soon as I insert a button it gives me an error
incompatible archive
Hello There,
The print button is ignoring the styling of all dropdown fields. I’m not sure what’s the issue. The script I have is below:
<script>window['printForm']=function(selector){function _cloneCanvas(newCanvas,oldCanvas){var context=newCanvas.getContext('2d');newCanvas.width=oldCanvas.width;newCanvas.height=oldCanvas.height;context.drawImage(oldCanvas,0,0);};function _getStyles(){var r='';$(document).find('link[type*="css"],style').each(function(){r+=this.outerHTML;});return r;};function _callPrint(w){if(w&&w["printMe"]) w["printMe"]();else setTimeout(function(){_callPrint(w);},50);};try{if(typeof jQuery!='undefined'){if(typeof selector!='undefined'){var $=jQuery,f=$(selector),c,e,h,t,w,d;if(f.length){c=f.clone();c.find('script').remove();c.find('input').each(function(){e=$(this);if(typeof e.prop('checked')!='undefined') e.attr('CHECKED',e.prop('checked'));e.attr('value',e.val());});c.find('SELECT').each(function(){e=$(this);t=f.find('[id="'+e.attr('id')+'"] option:selected').text();e.replaceWith(t);});c.find('TEXTAREA').each(function(){e=$(this);t=e.val();e.replaceWith(t);});h=c[0].outerHTML;w=$('#cff_iframe_for_printing');if(w.length==0){w=$('<iframe id="cff_iframe_for_printing" name="cff_iframe_for_printing" style="display:none;"></iframe>');w.appendTo('body');} d=w[0].contentWindow.document;d.write('<body>'+_getStyles()+h+'</body>');setTimeout(function(){d.close();$(d).find('canvas').each(function(i,e){_cloneCanvas(e,f.find('canvas:eq('+i+')')[0]);});var ua=window.navigator.userAgent,msie=ua.indexOf("MSIE ");if(msie!==0){w[0].contentWindow.document.execCommand('print',false,null);}else{w[0].contentWindow.print();}},1500);}else{throw"Form's selector is incorrect";}}else{throw'Requires the selector';}}else{throw'Requires the jQuery framework';}}catch(err){if(typeof console!='undefined') console.log(err);}};</script>
Thank you.
]]>Can i make the sumbit button to send the fields completed on email?
]]>Hello,
I have a new issue now. The print window doesn’t show the complete Date field. Instead it shows only the time (hour). Please find the url in the pastebin. Click the printform button to see the issue.
Also, is it possible to make the chart centered in the print window, like how it appears in the form?
Thank you.
]]>Hello again,
I observed a peculiar behavior in iOS chrome browser where in the print window opens, displays the print preview for brief second and closes automatically.
Whereas in iOS safari the print window stays open but doesn’t show anything in the preview. Just a blank grey page.
Any idea how to fix this?
Thanks.
]]>Hello,
I’m using the print button from this plugin. And when I click the button, in the print window the form is appearing fine but it does not have the form template that I have selected in the form (calculated fields form). It is appearing with default template. How to fix this?
Thank you.
]]>Dear Sir,
While using CFF forms , default thousand grouping came as “X,XXX,XXX” in USA style , how can we changed to Indian Style like “X,XX,XXX”…
Please help, thanks in advance.
Regards
Dear Sir,
I have a calculate field form, how can I print it from CP block, kinldy elaborate full process in simple words…
Please Help
Hello,
I’ve created a form using Calculated Fields Form and used CP Blocks to add a print button, which works perfectly. But when I insert a Page Break module to Calculated Fields Form, only the second page is printed, not all pages.
How can I change the code to print both pages, preferably on two pages?
Thank you kindly for your support.
Hello, and thank you kindly for developing CFF and CP Blocks.
I would like to use the Print Form block inside of Contact Form 7, but the instructions are somewhat vague to me.
It says that it will insert a javascript block with the printForm routine for printing the form only without other page’s area. From here, I’m a bit confused about where I should insert the jQuery selector
printForm(“#cp_calculatedfieldsf_pform_1”);
Thank you kindly for your support.
]]>Hello,
I just discovered this plugin when I was searching through the CFF docs about implementing Forms printing feature and boy I must say, this plugin is a life saver. I was quickly able to insert a block and a button to print the form. Just reviewed it with a much deserving 5 stars. ?? However my need is a bit different. Instead on printing 1 form, I would like to print 2 forms (I have 2 forms in the page) one below the other on click of the print button. How do I go about it?
Thanks.
]]>