davedw
Forum Replies Created
-
Forum: Plugins
In reply to: [Calculated Fields Form] Not all variables now appearing?Hi @codepeople
Spent some time on this today and got it 50% working.
Regular variables work, however the ones I pull from API’s and use the following now don’t work:
<script>OctGoSpecial = [code_snippet id=11 php];</script>
This worked pre the update to the plugin and the data is pulled back on a test page outside of the form, any ideas on how to solve this?
Forum: Plugins
In reply to: [Calculated Fields Form] Not all variables now appearing?Hi @codepeople
Apologies if I’m being a little dense here, but where do I make these changes?
The tables that display the data call out the figures via a span ID, is it actually in the calculations I need to update this?
e.g.
<span id="OctGoCostToCharge">
The calculations I use to work out some of the numbers look like this:
(function(){ if(fieldname8 > OctGoHours) return OctGoHours; return fieldname8; })()
Thanks,
Dave.
Forum: Plugins
In reply to: [Calculated Fields Form] Using an external shortcode with the CF plugin?I’ve worked this out now @codepeople
There was a formatting option on within code snippets and the <scripts> section should not have the ‘ for it to work.
Thanks for your help in getting me here!
Forum: Plugins
In reply to: [Calculated Fields Form] Using an external shortcode with the CF plugin?Thanks again for your help @codepeople – I know this is now out of the realms of your excellent plugin, but could the theme be adding that?
In the code snippet, I’ve even set it to strip the output so it’s plain text and it’s still doing it?
// Capture the output without HTML tags ob_start(); echo "{$unitRate}\n"; $output = ob_get_clean(); // Strip HTML tags from the captured output $output = strip_tags($output); // Display the output echo $output;
Forum: Plugins
In reply to: [Calculated Fields Form] Using an external shortcode with the CF plugin?Hi @codepeople
I’ve temp published my test page: https://www.teslaev.co.uk/cost-to-charge-calc-2/
The variable (which I can see in source) is: OctGoSpecial using the same format you specified above
Forum: Plugins
In reply to: [Calculated Fields Form] Using an external shortcode with the CF plugin?Many thanks for the quick reply @codepeople
Using custom HTML and putting in the above didn’t show me any errors, but the value didn’t get used in the form, does anything need to be done to tell it that it the CP_CALCULATED_FIELDS_VAR part?
Forum: Plugins
In reply to: [Calculated Fields Form] Combing two SUM calculations into oneThanks so much @codepeople I doubt I’d have got there, works a treat ??
Forum: Themes and Templates
In reply to: [Viral News] Homepage as ‘your latest posts’ – centre content?Thanks so much for your help ??
Forum: Plugins
In reply to: [Calculated Fields Form] Can I export a form?Just seen it listed as a Pro option in the upgrades tab ?? – sorry it confused me that it wasn’t below in the greyed out section.
If I upgrade though, will it keep my existing forms?
Dave.
- This reply was modified 4 years, 3 months ago by davedw.
Forum: Plugins
In reply to: [Calculated Fields Form] Can I export a form?Hi @codepeople is that still the case on the most recent versions? I can’t see that option within Settings, it’s not even greyed out as something in the Pro only version?
Thanks,
Dave.You are the best! – Thanks again for all the responses
You my friend are a legend!
One last thing to trouble you with, is there a way I can specify that they are £ currency, just so the £ symbol also lights up green or red?
No problem if not, just off to leave my first plugin review for you, can’t ask for more than this ??
Dave.
Doesn’t seem to work @codepeople ?
(function () { var results = { '#OctGoHome' : PREC((fieldname43*OctGoStandard)+(fieldname48*OctGoSpecial)+1*OctGoSC,2), '#OctGoFasterHome' : PREC((fieldname43*OctGoFasterStandard)+(fieldname48*OctGoFasterSpecial)+1*OctGoFasterSC,2), '#BulbHome': PREC((fieldname43*BulbStandard)+(fieldname48*BulbSpecial)+1*BulbSC,2), '#OVOHome': PREC((fieldname43*OVOStandard)+(fieldname48*OVOSpecial)+1*OVOSC,2), '#EDFGESRHome': PREC((fieldname43*EDFGESRStandard)+(fieldname48*EDFGESRSpecial)+1*EDFGESRSC,2), '#EDFGEDRHome': PREC((fieldname43*EDFGEDRStandard)+(fieldname48*EDFGEDRSpecial)+1*EDFGEDRSC,2), '#BGEDHome': PREC((fieldname43*BGEDStandard)+(fieldname48*BGEDSpecial)+1*BGEDSC,2); }, minimum = Number.MAX_SAFE_INTEGER, minimum_field, maximum = Number.MIN_SAFE_INTEGER, maximum_field; for(var i in results) { jQuery(i).html(results[i]).css('color', '#7b7b7b'); if(results[i] < minimum){minimum = results[i]; minimum_field = i;} if(maximum < results[i]){maximum = results[i]; maximum_field = i;} } jQuery(minimum_field).css('color', 'red'); jQuery(maximum_field).css('color', 'green'); })()
When implemented, no values are shown (this was for the home electric costs).
Thanks again for taking the time to reply, really appreciated.
Fully understood it is not an Excel or Google Sheets replacement, I’m just trying to replicate some of the functionality, it seemed like the best way to explain it.
The equations are a little more complex sadly, I couldn’t work out from the above how to implement them, an example line from the cost to charge section:
var result = PREC((fieldname7*OctGoSpecial)/fieldname8*fieldname12+(fieldname7*OctGoStandard)/fieldname8*fieldname13,2);
jQuery(‘#OctGoCostToCharge’).html(result);Understood that you aren’t here to help with customisations, the sheet works brilliantly, so this was just the icing on the cake so to speak. I’ll give it some thought and maybe drop you a message via your website.
Thanks,
Dave.Forum: Plugins
In reply to: [Calculated Fields Form] Altering the size and shape of a number input boxBrilliant, thank you! ??