• Resolved nathalizator

    (@nathalizator)


    Hello,

    I have a field which is a drop down menu
    such as Name : Car1 / Value : 2000
    Car2 / Value : 3000

    How can i echo somewhere in my page the selected car value ?
    Is there a shortcode for it or just a code ?

    Thanks ??

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

    (@codepeople)

    Hello @nathalizator,

    If you want to display the same option selected by the user through the “DropDown” field (fieldname1) in a tag of the same webpage with the form, for example, a <div> tag with the class name: “my-tag” (the field’s name, class name and tag are hypothetical, only to explain the process), you simply should insert a “HTML Content” field in the form with a piece of code similar to:

    <script>
    jQuery(document).on('change', '[id*="fieldname1_"]', function(){
    jQuery('.my-tag').html(jQuery(this).val());
    });
    </script>

    Best regards.

    Thread Starter nathalizator

    (@nathalizator)

    Hello there ! Is there a way to do it full php ?
    What i mean is more to echo the value.
    For Car1 it would print ” 2000″ for example. Is it possible?

    Plugin Author codepeople

    (@codepeople)

    Hello,

    If you are trying to access to a field in a previous submission (take into account that a form can be submitted multiple times by different users), you should implement your own code to read the entry in the database (of course you will need the row’s ID), un-serialize the object with the data submitted by the form (because it is stored as a serialized PHP object) to access directly to the field you want.

    Best regards.

    Thread Starter nathalizator

    (@nathalizator)

    Hello,
    I’m not sure if i did understand. In fact i need to get the value of the car ( which is the price ) in order to display it somewhere in my page without the entire form.

    Plugin Author codepeople

    (@codepeople)

    Hello,

    I’m trying to describe the different solutions because is not clear where is the value of car you want to load.

    If you want to display the value of the car (for example the fieldname3) submitted by the form in the thank you page (It is the page where the users are redirected after submit the form), you simply should insert in the thank you page the shortcode for the summary with the specific tag for the field, as follows:

    [CP_CALCULATED_FIELDS_RESULT]<%fieldname3_value%>[/CP_CALCULATED_FIELDS_RESULT]

    Best regards.

    Thread Starter nathalizator

    (@nathalizator)

    Yes that almost what i want to do except it’s directly in the page that display the form ! But the shortcode is not working, maybe it’s because i need the pro version?

    Plugin Author codepeople

    (@codepeople)

    Hello @nathalizator,

    If you want submit the form, and display a summary of the values submitted using the shortcode: [CP_CALCULATED_FIELDS_RESULT], you will need the professional version of the plugin, because this shortcode is not present in the free version.

    Best regards.

    Thread Starter nathalizator

    (@nathalizator)

    Thanks ??

    Thread Starter nathalizator

    (@nathalizator)

    One last question i wanted to be sure before purchasing the pro version.
    Will i be able to echo the value in any page ?
    Here is what i want do to :
    I have a page when i show all the price of my cars. ( The price of car are set as the “value” of the drop down element on my calculator.
    Will i be able to echo the “value” (price) of each “choice” of my drop down element in any page of my website with this method ?

    Plugin Author codepeople

    (@codepeople)

    Hello,

    For example, assuming that the field is the fieldname1, you can insert the shortcodes:

    [CP_CALCULATED_FIELDS_RESULT]<%fieldname1_value%>[/CP_CALCULATED_FIELDS_RESULT]

    however, the value would be accessible while the session be active, or until the user submit a new value.

    Best regards.

    Thread Starter nathalizator

    (@nathalizator)

    Okay i guess it might not work for what i want. Maybe the better way would be to get the value directly in the ccf database?
    Because i will have a page that will be completely independant from the calculator. ( The calculator is shown only on single car page).

    In fact i want to be able to get the value of each choice of the dropdown element so it will be more dynamic if i set all my price in the ccf setting form.

    Plugin Author codepeople

    (@codepeople)

    Hello,

    The solution to use depends of each project, in your case would be needed access to the data stored in the plugin’s database.

    Best regards.

    Hi there, I have professional version of CFF. I am using it for a rent a car website I am working on. Right now I`m stack with an issue. I have a form on first page that has a select option (with links as values) and based on select I have a window.open onclick button that redirect me based on selected values links. Now I wander if there is any possibility to populate next page fields (not a thank you page) with info from first form? Thank you

    • This reply was modified 7 years, 10 months ago by crissgabriel.
    • This reply was modified 7 years, 10 months ago by crissgabriel.
    Plugin Author codepeople

    (@codepeople)

    Hello,

    Yes, that’s possible, the second form must be inserted in the thank you page of the first form, furthermore, in the second form beside the form’s shortcode, should be inserted the shortcode for the summary, but with a piece of code to populate the second form with the data submitted by the first one. More information in the following link:

    https://cff.dwbooster.com/documentation#populate-form-b-with-a

    If you have additional questions concerning to the professional version of the plugin, your should create a ticket in my personal website:

    https://cff.dwbooster.com/contact-us

    Best regards.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Echo value of one field somewhere’ is closed to new replies.