Streaming live at 10am (PST)

Why doesn't this script work?


#1

I want to set required and not required in a inputbox in a form via a radio button, but it does not work.
I tested it outside of webflow and it worked.

   	$("#zonder partner").click(function() {
$("#Voornaam-RSVP-Partner").prop("required", false);
$("#Familienaam-RSVP-Partner").prop("required", false);
$("#met partner").click(function() {
$("#Voornaam-RSVP-Partner").prop("required", true);
$("#Familienaam-RSVP-Partner").prop("required", true)
})

});


Here is my public share link: LINK
(how to access public share link)


#2

#zonder partner doesn’t seem to be a correct selector, as there is a space between the words.


#3

By mistake I sent the wrong code, indeed it should be #zonder-partner, but that is not the problem.
This is the used code:

("#zonder-partner").click(function() { ("#Voornaam-RSVP-Partner").prop(“required”, false);
("#Familienaam-RSVP-Partner").prop("required", false); ("#met-partner").click(function() {
("#Voornaam-RSVP-Partner").prop("required", true); ("#Familienaam-RSVP-Partner").prop(“required”, true)
})
});


#4

Without a link to the published page, there is no way we can debug this for you.

Have you tried seeing if there are any errors in the console?


#5

Helas I can not give a link to the page.
There is no error in the console. Only when I put th code into the code editor in webflow it shows true and false in red.

webflow