Hello,
Is it possible to lock the field values so they can’t be changed from the default value we set? Also, anyway to mirror fields so they have the same value when someone enters it.
Ex: Comparison Calculator
Field 1 for Scenario 1 is price = $10,000
Field 1 for Scenario 2 is price = same as field 1
This way someone can’t compare two different values. They must be the same.
1 Like
Max
September 4, 2024, 11:05am
3
Hey there @Ryan_Krause
Could you please the fields in your widget where the default values should be fixed? I’ll be happy to check if anything can be done
As for the 2nd idea, you’d like the entered valued for the field A to be automatically copied to the field B, right?
Hi Max,
Thanks for the follow up. You are correct in the ‘copy’ statement.
here is a summary:
CD Amount = Any Value
CD Number of Compound Periods = 1 (this value stays same)
CD Number of Years = Any Value
Note Amount = Same as CD Amount
The Other Field for Compound Periods = 2 (this value stays same)
The other Number of Years field = CD Number of Years
Ryan.
1 Like
Max
September 4, 2024, 3:44pm
5
Thank you!
Unfortunately, there is no way to automatically pull entered values from one field to another one.
However, it’s possible to fix the default values and here is the solution from our devs:
const waitForElement = (selector, root = document) => new Promise(res => {
let i = 0;
const check = () => {
const component = root.querySelector(selector);
if (component) {
res(component);
} else if (i !== 50) {
setTimeout(check, 100);
i++;
}
};
check();
});
waitForElement("[class*='form__Container-sc']").then(form => {
['m0baxovu', 'm0bbk9w3'].forEach(id => {
const input = form.querySelector(`#${id}`);
if (!input) {
return;
}
input.disabled = true;
});
});
Add it to the Custom JS field on the Settings tab of your widget’s settings and let me know how it worked
So this worked great for locking default values. Unfortunate we can’t copy field values into each other. Did the developer say anything about an ‘event listener’ or some way to monitor the field value and then update it?
1 Like
Max
September 5, 2024, 10:09am
7
Hi @Ryan_Krause
As I mentioned in the previous message, unfortunately, there is no way to copy field values into each other. I am really sorry
We agree that it would be a great option and I’ve added this idea to the Wishlist on your behalf - Automatically pull entered value from one field to another