Hello @asjad492
You are requesting a custom behavior. In this case, you should request a custom coding service via the plugin website:
https://cff.dwbooster.com/customization
Best regards.
I am not requesting custom behavior. I am just referring to old thread in which you said that one field can be evaluated without dynamic evaluation option turning on. But now you are saying it can’t be done
Hello @asjad492
I have described an alternative that you have not been able to adjust to your project. Therefore, you need someone to implement it for you, and we can no longer implement your project through the WordPress forum. If you need us to implement your project, do not hesitate to contact us via the plugin website.
Best regards.
What alternative you described? I couldn’t get it. I can’t find any second method in this thread. I am saying that I don’t want all calculated fields to be dynamically evaluated. I want one of them to be excluded from dynamic evaluating
Hello @asjad492
In the current version of the plugin that is not possible without customizing its behavior via code.
Best regards.
But in one of previous threads (I shared link) you shared a method and it worked perfectly. This time the issue is there os a for loop. So I want to know how to write it under <script> tags as you shared code in last thread
Hello @asjad492
Exactly, if you don’t know how to adapt the code to your new project, you can contact us via the plugin website.
Best regards.
For mt understanding, why you didnt use | n in the code under script tags?
Hello @asjad492
Only the equations in calculated fields replace the fields names by their values. So, you don’t need it in the script tags.
Best regards.
Could you please check it? I tried my best to adjust the code. Please tell if there is any error in it?
<script>
fbuilderjQuery(document).one('showHideDepEvent', function(evt, form_id){
var f = jQuery('[name="cp_calculatedfieldsf_id"][value="7"]').closest('form');
jQuery(f).on('change', '[id*="fieldname11_"]', function(){
var fields = [fieldname13, fieldname14, fieldname15];
for(var i in fields){
if(i<getField('fieldname11', f).val(true, true)) ACTIVATEFIELD(fields[i]);
else IGNOREFIELD(fields[i]);
}
});
jQuery('[id*="fieldname11_"]', f).change();
});
</script>
Fieldname 11 is slider, and other are number fields
Hello @asjad492
In your line of code:
var fields = [fieldname13, fieldname14, fieldname15];
The fields names are strings and must be enclosed between single or double-quotes symbols:
var fields = ['fieldname13', 'fieldname14', 'fieldname15'];
Best regards.
All good now?
<script>
fbuilderjQuery(document).one('showHideDepEvent', function(evt, form_id){
var f = jQuery('[name="cp_calculatedfieldsf_id"][value="7"]').closest('form');
jQuery(f).on('change', '[id*="fieldname11_"]', function(){
var fields = [‘fieldname13’, ‘fieldname14’, ‘fieldname15’];
for(var i in fields){
if(i<getField('fieldname11', f).val(true, true)) {
ACTIVATEFIELD(fields[i]);
}
else {
IGNOREFIELD(fields[i]);
}
}
});
jQuery('[id*="fieldname11_"]', f).change();
});
</script>
Hi, up to 3 fields, it works. But as I increased number of fields, it isnt working.
<script>
fbuilderjQuery(document).one('showHideDepEvent', function(evt, form_id){
var f = jQuery('[name="cp_calculatedfieldsf_id"][value="7"]').closest('form');
jQuery(f).on('change', '[id*="fieldname11_"]', function(){
var fields = ['fieldname13', 'fieldname14', 'fieldname15', 'fieldname16', 'fieldname17', 'fieldname18', 'fieldname19', 'fieldname20', 'fieldname21', 'fieldname22', 'fieldname23', 'fieldname24', 'fieldname25', 'fieldname26', 'fieldname27', 'fieldname28', 'fieldname29', 'fieldname30'];
for(var i in fields){
if(i<getField('fieldname11', f).val(true, true)) {
ACTIVATEFIELD(fields[i]);
}
else {
IGNOREFIELD(fields[i]);
}
}
});
jQuery('[id*="fieldname11_"]', f).change();
});
</script>
Hello @asjad492
I’m sorry, but the support does not cover the development of the users’ projects.
Best regards.