Hi,
For example, assuming that the fields: A, B, and C, are: fieldname1, fieldname2, and fieldname3, you simply should insert a calculated field in the form, and as the calculated field is not relevant for the form’s interface, tick the checkbox: “Hide Field From Public Page”. Finally, assign the equation below to the calculated field:
(function(){
if(fieldname1+fieldname2+fieldname3 > 100 ) alert( 'The sum of fields: A, B, and C cannot be greater than 100' );
})()
Best regards.
Thread Starter
Damn!
(@greedymind)
thank you, Is there anyway I can do this with the help of 3 Sliders?
Hi,
The process is the same, but instead to use “Number” fields, insert sliders, unfortunately the maximum values of fields are not modified at runtime (you can use 100 in each of them), but at least you can indicate the user that values selected are incorrect.
Best regards.
Thread Starter
Damn!
(@greedymind)
hello,
can you tell me how to set the values of sliders according to the results from a calculated field. Lets say i have calculated field with a result of 50, i want the slider to also point 50.
Hi,
Yes, that’s possible, I’ve answered a similar question in the following support thread:
https://wordpress.org/support/topic/how-to-feed-the-value-to-a-slider?replies=3
Best regards.
Thread Starter
Damn!
(@greedymind)
Hello,
Thank you, It worked. One more thing, Is it possible to add a % symbol after the slider’s numeric field? because i’m trying to make the slider show percentages.
Thanks in advance.
Thread Starter
Damn!
(@greedymind)
(function(){
if(fieldname1+fieldname2+fieldname3 > 100 ) alert( 'The sum of fields: A, B, and C cannot be greater than 100' );
})()
The above code triggers the alert twice, is it possible to make it alert once?
Also how to force a Div container to align right?
Sorry for asking too many questions.
Thanks in advance.
Hi,
To align the caption at right, you simply should insert a “HTML Content” field with the piece of code below as its content:
<style>
.slider-container div { text-align:right; }
</style>
About the alert message that is displayed twice, what version of the plugin are you using?
Best regards.
Hi,
If you need more specific support, I can offer you a custom coding service, in whose case, you should contact me through my personal website:
http://cff.dwbooster.com/customization
Best regards.
Thread Starter
Damn!
(@greedymind)
I’m using version 1.0.113
Hi,
In this case I recommend you a different solution:
1. Insert after the “Sliders” fields, a “HTML Container” field, and enter, as its content, the piece of code below:
<div class="my-error-mssg"></div>
<style>
.my-error-mssg{font-weight: bold; color: #ff0000;}
</style>
2. Modify the equation as follows:
(function(){
jQuery( '.my-error-mssg' ).html( IF(fieldname1+fieldname2+fieldname3 > 100, 'The sum of fields: A, B, and C cannot be greater than 100', '') );
})()
I’m sorry, but if you need additional help implementing your equations, you should hire a custom coding service through my personal website:
http://cff.dwbooster.com/customization
Best regards.