CodePeople2
Forum Replies Created
-
Forum: Plugins
In reply to: [Calculated Fields Form] Help Adding RulesHello @pexel
I’m sorry, I don’t know how you implemented your equations or use the formData constant in them. However, if you want to compare the date entered by the user with today, assuming the date field in the form is fieldname123, you can use the following piece of code as part of the equation:
if( TODAY() < DATEOBJ(fieldname123) ) {
/* The code to use when the fieldname123 date is in future */
} else {
/* The code to use when the fieldname123 date is in the past or today */
}Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Failed Security CheckHello @grudzinski
Thank you so much for using our plugin. The plugin displays the “Failed security check” message only if you have enabled the “Protect the forms with nonce” option from the “Troubleshoots Area & General Settings” area, accessible through the “Calculated Fields Form > Troubleshoots Area & General Settings” menu option and the nonce verification fails.
Nonce verification may fail if a cache management plugin is installed and loads the form from the cache. In such cases, an outdated nonce value is retrieved from the cache, causing the verification to fail when the form is submitted.
The possible solutions are:
- Insert the form shortcode with the iframe attribute set at 1. E.g.
[CP_CALCULATED_FIELDS id="6" iframe="1"] - Or you can simply deactivate the nonce protection from the “Troubleshoots Area & General Settings” section.
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Using letters in calculationsHello @life2
Please provide the link to the page that contains the form to check the fieldname1 value.
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Using letters in calculationsHello @life2
We included, In the latest plugin update, specific operations to make the process easier. Now, you can implement the equation as follows:
CODETOCHAR(25+fieldname1)Note that the plus (+) operator is overloaded in JavaScript. It is used for adding numbers or concatenating texts. However, the concatenation takes precedence.
To solve the ambiguity I recommend using the SUM operation instead of the plus operator:
CODETOCHAR(SUM(25, fieldname1))If the issue persists, please provide the link to the page containing the form to check the fieldname1 value and the equation in action.
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Insert CFF Results Block MissingHello @cambob
Thank you so much for using our plugin. Yes, unfortunately the shortcode for result [CP_CALCULATED_FIELDS_RESULT] and the shortcode for results list [CP_CALCULATED_FIELDS_RESULT_LIST] are part of the commercial plugin distributions (Professional, Developer, and Platinum).
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Using letters in calculationsHello @life2
You’re not simplifying the fraction but rather converting it from fraction notation to a mixed number. The current plugin version doesn’t offer a specific operation to perform this conversion; however, it’s a basic mathematical procedure. To achieve this, extract both operands—the numerator and the denominator—and then follow these steps:
- Compute the integer division using the FLOOR operation.
- Determine the division remainder using the REMAINDER operator.
- Concatenate the integer result with the remainder over the original denominator to display the mixed number.
If you need we implement it to your project, contact us via the plugin website: Contact Us
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Using letters in calculationsHello @life2
Yes, you can use the String.fromCharCode:
String.fromCharCode(65)
String.fromCharCode(66)
String.fromCharCode(67)
Best regards.
Forum: Reviews
In reply to: [Calculated Fields Form] It is tremendously powerful and useful.Forum: Plugins
In reply to: [Calculated Fields Form] Formatting text in options of dropdown fieldHello @life2
The HTML
<OPTION>tags do not render HTML. So, you have two alternatives:You can use superscript and subscript Unicode characters https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts
Or if you prefer using tags like
<sup></sup>, and<sub></sub>you should tick the “Include a search box” checkbox in the DropDown field’s settings because it emulates the control with other tags than SELECT and OPTION.Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Form no longer redirectingHello @iamdavidkennedy
Thank you so much for using our plugin. If you want to deactivate the form submission button on all your forms at once, please follow the steps below:
- Visit the “Calculated Fields Form” menu option.
- Scroll down to the “Default Settings” section.
- Untick the “Display Submit Button by Default” checkbox and tick the “Apply To Existing Forms (It will modify the settings of existing forms)”
- Finally, press the “Update” button and visit the public form.
Note you can always contact us directly through the plugin website. Contact Us
Best regards.
Forum: Reviews
In reply to: [Calculated Fields Form] Very good, everything works as it should.Forum: Plugins
In reply to: [Calculated Fields Form] Calculated field showing dropbox valueHello @ohtusabes
You can apply to the DIV field all CSS rules you want to obtain the preferred design.
E.g.
<div data-cff-field="fieldname82" style="border:1px solid #7e8993;border-radius:3px;"></div>Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] Calculated field showing dropbox valueHello @ohtusabes
The calculated field contains an input tag. It cannot render HTML. However, you can use it as an auxiliary to return the HTML structure but display the result in another control that renders HTML. Please insert an “HTML Content” field in the form and enter a DIV tag in its content with the data-cff-field attribute indicating the name of the field whose value you want to display in the tag:
<div data-cff-field="fieldname82"></div>Finally, since the calculated field is used as an auxiliary, it is irrelevant in the form interface, you can hide it by ticking a checkbox in its settings.
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] loop back to 00 when 100 is reachedHello @cambob
I’m sorry, I don’t understand your explanation. However, if you have a number X, and you want to subtract 100 to it if the number is greater than 100, you can use the formula:
X - (100<=X ? 100 : 0)Or if you prefer using the IF operation instead of the ternary operator:
X - IF(100<=X, 100, 0)Now, you need only to replace X by the corresponding number of field’s name.
Best regards.
Forum: Plugins
In reply to: [Calculated Fields Form] About rounding numbersHello @life2
Yes, that’s possible. In this case, you can use the ROUND operation by passing 0.5 as its second parameter:
ROUND(X,0.5)
Furthermore, if you want to ensure that returns like 1.0 are transformed into 1 (or the corresponding integer number), you need only to multiply the result by 1:
ROUND(X,0.5)*1
E.g.
ROUND(4.6,0.5)*1 returns 4.5
ROUND(4.2,0.5)*1 returns 4
ROUND(4.8,0.5)*1 returns 5
Best regards. - Insert the form shortcode with the iframe attribute set at 1. E.g.