Disabling Multiple Form Fields When Checkbox is Checked
SOLVE
Hi All,
I can't, for the life of me, figure this part of my form out. I have 3 fields that I want to be disabled when a specific box is checked and I haven't had any luck with any docs or community posts being able to solve this issue. Can anyone help with this?
Disabling Multiple Form Fields When Checkbox is Checked
SOLVE
Hi Alex. Good question. The listeners are important because it gives you confidence the form is on the page. Sometimes things load faster than others and you can run code dependent on something that is not fully loaded in the page. So you get bugs where it works sometimes and breaks other times.
If you are new to javascript, make sure you learn the difference between document ready, on window load, dom inserted, timeout, and callbacks. All of these things determine when your javascript will file and you will often want control on when that happens.
Disabling Multiple Form Fields When Checkbox is Checked
SOLVE
HI,
I got a query on hubspot Landing page. I have got 5 check boxes in a landing page. If i check the last one all other opted must be unchecked and and if any of the first 4 is checked the last one must be un checked.
Disabling Multiple Form Fields When Checkbox is Checked
SOLVE
HI
I am new to hubspot and i have got a query in landing pages.
I have got 5 check boxes in a landing page. If i check the last checkbox all other opted must be unchecked and if any of the first 4 is checked the last one must be un checked.
EX: Like a Preference form. If thy click optout all their subscriptions must be unchecked and vice versa.
Nov 22, 202111:31 AM - edited Nov 22, 202112:24 PM
Top Contributor | Elite Partner
Disabling Multiple Form Fields When Checkbox is Checked
SOLVE
Hey Alex!,
Do you happen to have a jsfiddle of this, or maybe a codepen example? I've tried this code in my form and replaced the proper parts of it, but it breaks the form and doesn't dispay anything.
Disabling Multiple Form Fields When Checkbox is Checked
SOLVE
Hey @Jake_Lett, thanks for replying. I'm confused; will the script not work without event listeners? I'm still learning js and consider myself at the very, very begginer stage.
Disabling Multiple Form Fields When Checkbox is Checked
SOLVE
Hi Alex. Good question. The listeners are important because it gives you confidence the form is on the page. Sometimes things load faster than others and you can run code dependent on something that is not fully loaded in the page. So you get bugs where it works sometimes and breaks other times.
If you are new to javascript, make sure you learn the difference between document ready, on window load, dom inserted, timeout, and callbacks. All of these things determine when your javascript will file and you will often want control on when that happens.