I am trying to create some logic that will screen the user and redirect him to an application page if the user qualifies.
![](https://static.wixstatic.com/media/a27d24_bafea52514684895aae6928adaee5301~mv2.png/v1/fill/w_61,h_30,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_bafea52514684895aae6928adaee5301~mv2.png)
![](https://static.wixstatic.com/media/a27d24_90df8f5f0290441682af1e635d5e37cc~mv2.png/v1/fill/w_63,h_32,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_90df8f5f0290441682af1e635d5e37cc~mv2.png)
Can someone help with the code ?
Here is what I wrote:
$w.onReady(function () { // Write your JavaScript here $w("#btnAgeYes").onClick((event) => { $w("#stEligible").changeState("Bank"); } ); $w("#btnAgeNo").onClick(() => { $w("#stEligible").changeState("Bank"); } ); $w("#btnBankYes").onClick(() => { $w("#stEligible").changeState("B2B"); } ); $w("#btnBankNo").onClick(() => { $w("#stEligible").changeState("B2B"); } ); $w("#btnB2bYes").onClick(() => { if ($w('#btnAgeYes').label === "Yes" && $w('#btnBankYes').label === "Yes") {wixLocation.to("/application")} else {wixLocation.to("/donotqualify")}
Take this example for guiding reference. It is a very old one, but should still work for your purposes.