How to fill out fields with drop down box

[ad_1]

Hello @anthrax-vx

Thank you very much for using our plugin.

You can use calculated fields. I’ll try the describe the process with a hypothetical example. Assuming you have the DropDown field fieldname1 with two choices: “A” and “B”, and you want to fill the calculated field with the number 123 when the user selects the choice “A” and 321 when selects the “B”.

The equation, in this case, can be implemented as follows:

IF(fieldname1 == 'A', 123, 321)

If there are additional choices, you can nest multiple IF operations as follows:

IF(fieldname1 == 'A', 123, IF(fieldname1 == 'B', 321, 456))

However, if the dropdown field includes multiple choices, it is preferable to implement the equation with function structure:

(function(){
if(fieldname1 == 'A') return 123;
if(fieldname1 == 'B') return 321;
if(fieldname1 == 'C') return 456;
if(fieldname1 == 'D') return 654;
})()

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer