The Lead/Customer arrives on a page where there is a form.
This form contains a select field that pulls information from a CPT. The CPT has 5 options to choose from, each of which has a reference value for calculation.
These reference values can have numbers in the style of 0.0000 (must have this possibility)
When selecting one of the options through the select field, it fills in another 6 hidden fields, where these fields are used in the calculation field.
After the Lead, he inserts his name, e-mail and telephone (this I know bricksforge can do);
After the Lead, it informs a monthly Consumption value (Field Range Filter). This value will also be used in the calculation field along with the other information in the select field.
Lead clicks the submit button.
This calculation field, after calculating according to the informed formula, will insert the result in another CPT for lead capture.
After that, he is redirected to the thank you page where he presents the calculation value to Lead.
Yes. That’s right. Pionet has this field, WS Forms has this field. I’ll send an example of their sites and also the formula I need for you to have as an example.
Will I be able to do the process I explained before?
I mean, get information from a CPT through a select field, calculate, insert the captured data into another CPT and then display it on another result page? Until displaying the result on another registration confirmation page? (thank you in this case).
a field that I saw here and that you will need to have is the range filter
and confirm if the select can pull data from a CPT and insert it in hidden fields.
2 things you need, in addition to the calculation field to be able to perform the step by step I said:
the select field can pull information from a CPT (I use JetEngine) I tested it here and it is not pulling.
Scenario: Pull the name of the CPT and then get the results and insert into hide type fields.
webhook: after the whole process, you can send them to a webhook
In blue what will appear to be chosen.
In red what will be inserted in the hidden fields to be used in the calculation field.
Could you put together a tutorial using this my need? I tried to assemble as I described initially but I couldn’t. I believe it will be able to cover most users’ needs.
There you can build the options from your CPT data.
Regarding the populating of the input hidden field: The Bricksforge Panel would be perfect for that: Bricksforge Panel – Bricksforge Docs With the “On Change” event, you can listen for select input changes and automatically fill your hidden input field with the new value of the select field.
If you handle the select field populating, I’ll help you with the Panel part after sending me admin access
I think, especially if you’re willing to pay, to hire someone elsewhere, might get you results faster than trying to get a very specific case natively implemented. Obviously all up to you haha but anybody with decent js skills should be able to set this up fairly quickly
Just re-read your requirements and unless Daniele has a way of adding data attributes to the options, I don’t see how it would be possible to pull in all the values associated with the cpt.
A select with just the cpt names is easy, just not adding those various numbers you’ve got associated to each one. Not enough of a php head to know if there is some filter or hook to do that. Assuming it’s not currently possible, here’s what I’d do:
Instead of just 1 form, I’d split it up into 2 parts:
Part 1: Use a queryloop to get your posts and add the associated values as data attributes.
Part 2: The form with all the fields and calculation fields except for the cpt selector.
With a little js, on click of one of the posts from Part 1, get all the associated numbers and set the value of the corresponding fields.
To add the attributes you can just add them via bricks, using the corresponding dynamic tags, for example like so:
Let’s say your html structure looks something like this
<div class="your-cpt" data-value1="12345" data-value2="3424">title and image or whatever</div>
Setup an event like so:
For the action choose the last one “Javascript” and in the JS code field, do something like this:
//Get your values from the clicked post
const value1 = trigger.getAttribute('data-value1');
const value2 = trigger.getAttribute('data-value2');
//Pass the values into the corresponding form fields
document.querySelector('input[name="form-field-name1"]').value = value1;
document.querySelector('input[name="form-field-name2"]').value = value2;
Haven’t properly tested but in theory it should work haha