Unable to debug the code

Hello Sir/ Madam

I have got a form named “Get a Quote” in my website. The form has a radio button field which has values like “One Way”, “Round Trip”, “Multicity”. It also has date fields like “Departure Date” and Return Date". I want the form in such a way that when the user clicks on "One way " option the “Return Date” field should get disabled and if the user selects “Round Trip” or “Multicity” then both the date fields should be enabled. I have return the below code but it is making no difference can you help me with the same.

$w.onReady(function () {
if( $w(“#radioGroup1”).value === “Option1” )
{
$w(“#datePicker2”).disable();
}
else {
$w(“#datePicker1”).enable();
$w(“#datePicker2”).enable();
}
});

It would be really great of you if you help me with the same as soon as possible as i have got a deadline to solve the same.

Thanking you in advance

You will need an onClick() or an onChange() event handler to handle the user’s choice.

Hello Sir
Thankyou for answering can you help me with the whole code?
It would be really great of you
Thankyou

You can use an onChange() to detect the user’s selection:

$w("#myElement").onChange( (event) => {
  let newValue = event.target.value;  // "new value"
});

We are unable to provide full code solutions. Wix provides many resources to help users learn how to get the most out of Corvid. We encourage users to take advantage of these resources which include video tutorials, full app examples (which can be loaded into the user’s editor), API documentation, and a wealth of articles describing a wide range of topics - from beginner to advance.

You may want to check out the Wix Marketplace - it’s a hub where you can look for Corvid (and other) experts for hire.