Hi Clofly,
Trust you are doing good!
We are fine if the logic works at client level on the external page, In the workaround you mentioned, would the logic function only once after the form is loaded or would it function as many times as the condition meets?
In my Example - If my Business Type Option set (from the landing page) is selected as Type A then make fields F1, F2, F3 as Business Required and If it is Type B then make F5, F6 as Business Required.
Step 1: After form loads, I select Business Type as A ---- and Fields F1, F2, F3 would turn business required.
Step 2: I change the Business Type from A to B, would the Fields F1, F2, F3 become set as optional and Fields F5, F6 be set as Business Required?
Step 3: I change the Business Type from B to A again, would the Fields F5, F6 become set as optional and Fields F1, F2, F3 be set to Business Required ?
or only Step 1 work?
The reason why I am asking this is, we have requirements to conditionally hide/show as well as set the field as Business Required or Optional in our externally hosted landing page.
and we tried to hide a field based on one option set value using After Form Load function and were not able to achieve the results (the fields weren't hidden when I select the value for the first time).
One important thing that I might have not communicated properly in my previous post is
- My conditions to hide/show, set as Business Required, Optional are on Two options (boolean) as well as Option sets
We raised a MS premier ticket to get some help and we got this as the response.
We have checked with our PG team on this ask as well as internal resources. As of now this would not be possible through a marketing form handlers. We currently have only functions that can work on formLoad, afterFormLoad, formSubmit or so. Since these are all a one-time function handlers it either happens at the start or at the end. In our ask, we will need a handler that monitors the whole page real-time for the change of the field value. As of now this is not possible through a marketing form handler. However you can go ahead and add your own JavaScript directly to the page as a web page development without a marketing form handler used in the code. We are working internally on this to check if this will come up as a feature in the future, however as of now we do not have a mechanism to execute this through JavaScript of a marketing page handler and you would have to code it in your page directly.
Regards,
Shyam