Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @kmillerds,

    I’m sorry, I don’t understand totally your question, if you want to use the values of dropdown field in the equation, you should enter the values of choices.

    Best regards.

    Thread Starter kmillerds

    (@kmillerds)

    @codepeople,

    So when you have a drop down field there are two columns one that say “text” and one that say “Value” (see example:https://kmillerdesignstudios.com/wp-content/uploads/2017/10/example.png). What I am trying to do is pull just the info in “text column” instead of the info in the “value column”. I need both Columns to have different formation in them and will like to pull information from the one “PULL DOWN FIELD” and send the information to two different other fields.

    Please look at the image I attached it might explain it better.

    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @kmillerds,

    The DropDown fields are represented with <select></select> tags in HTML. The <select> tags include <option> tags, for example:

    <select id="fieldname1">
    <option value="the value entered into the value column">the value entered into the text column</option>
    <option value="the value entered into the value column">the value entered into the text column</option>
    <option value="the value entered into the value column">the value entered into the text column</option>
    <option value="the value entered into the value column">the value entered into the text column</option>
    </select>

    In html, if you ask for the value of the select tag, it would be the “value” attribute of the option selected.

    So, assuming you want get through the equation both: the value and text of the option selected in the fieldname1 field, you should use a piece of code similar to the following one:

    (function(){
    var value = fieldname1;
    var text  = jQuery('[id*="fieldname'+'1_"] option:selected').text();
    
    /** NOW YOU CAN USE BOTH VARIABLES IN THE REST OF THE EQUATION **/
    })()

    Best regards.

    Thread Starter kmillerds

    (@kmillerds)

    @codepeople

    thanks for your help, so far I’m still not able to get it to work. Could you explain to me what this part mean –[id*=”fieldname’+’1_”]– ?

    so basically if I have this in my drop down:
    example:
    <select id=”fieldname7″>
    <option value=”fieldname22″>1</option>
    <option value=”fieldname23″>2</option>
    <option value=”fieldname24″>2</option>
    </select>

    I want to be able to do this in another field but grabbing the “Text” not the “Value” of fieldname7:
    example:
    (fieldname7*13)

    so what should I put in this field to do this?

    thanks ??

    Plugin Author codepeople

    (@codepeople)

    Hello,

    You cannot use the fields’ names in the options of a dropdown field, because the plugin does not replace the fields names by their values in this context.

    If you want implement this equation: fieldname7*13 but using the text of choice selected in the dropdown field fieldname7, the equation would be:

    (function(){
    var value = fieldname7, text = jQuery('[id*="fieldname'+'7_"]').text();
    return text*13;
    })()

    In the previous equation the piece of code:

    text = jQuery('[id*="fieldname'+'7_"]').text();

    extracts the text of the choice selected with jQuery, and use the selector ‘[id*=”fieldname’+’7_”]’ and not directly ‘[id*=”fieldname7_”]’ because the plugin replaces in the equations the texts with the format: fieldname# by the corresponding field’s value. Furthermore, it contains value=fieldname7, even it is not used in the equation, because the plugin requires to know the equation depends of the fieldname7 field.

    Best regards.

    Thread Starter kmillerds

    (@kmillerds)

    Thanks It works!! only thing I had to add to it is the “option:selected”..Thanks once again you are the best!!

    Plugin Author codepeople

    (@codepeople)

    Hello @kmillerds,

    Yes you are right I’ve forgotten it. The correct equation would be:

    (function(){
    var value = fieldname7, text = jQuery('[id*="fieldname'+'7_"] option:selected').text();
    return text*13;
    })()

    Best regards.

    hello
    I want to have a page like this:
    https://exchanging.ir/sell/

    can you help me?

    Plugin Author codepeople

    (@codepeople)

    Hello @farzane,

    I’m sorry, but your request is too general.

    Best regards.

    hi
    do you have any document to learn how to work with this plugin?

    Plugin Author codepeople

    (@codepeople)

    Hello @farzane,

    The plugin is distributed with five predefined forms you can access to understand the plugin, or to use as template to create your own forms. Furthermore, for testing the features of the professional version (and some of the developer version) of the plugin, you can access to our online demo website:

    Public website:
    https://demos.net-factor.com/calculated-fields-form/

    WordPress:
    https://demos.net-factor.com/calculated-fields-form/wp-login.php

    And finally, you can access to the official documentation’s page:

    https://cff.dwbooster.com/documentation

    Best regards.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Is there away to pull the “text” as well as “value” from one drop down menu’ is closed to new replies.