Hi,
I'm building a form for a client and they have a requirement to populate certain checkboxes when another checkbox field is checked. I'm familiar with how to extend marketing forms with javascript but I just need some guidance on the actual function I would use to have it populate a checkbox field.
Thanks Petr. I ended up going with something similar for the solution!
Hi,
You can use the form HTML editor to include some ID to the element wrapping the text you want to hide:
Like I did in the example above. I added id called MyTextToHide. Form editor will not remove this ID from the HTML, so you can use the Javascript to modify this field on the fly.
Thank you.
Petr
Hi Steve,
It's a little more complex than that but yeah it needs to be when a checkbox is checked then go and check other checkboxes on the form. I'm already aware of that developer guide and I've been able to get some code to work but I'm stuck on what the actual statement is to check a checkbox field. I've done some Googling but haven't had much luck. I also have a requirement to hide some text and I can't figure out how to do that if it's not a field. It's just plain text a paragraph on the form.
Hi pdr469,
For example, do you mean that you want to check the 'Do not email' when the 'Remember me' is checked in the following screenshot?
You want to trigger the script when the first checkbox is checked or the form is submitted?
Here is the doc about JS in marketing form, you could have a look:
Extend marketing forms using code (Dynamics 365 Marketing Developer Guide) | Microsoft Docs
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156