@chaim-kram It seems to be working now yes, weird because before it didn’t. Thank you anyway.
I am facing some same problems here right now. My Website is not shown correctly, but in the editor everything seems fine. I checked my website on chrome and there the fonts are different. I checked my website on firefox, same problem. on Safari the fonts are correct but the texts are different.
left one is the editor version. right one is my website online. can anyone help me cause i am getting crazy over here.
Help WIX is not working with safari10.1.2? why?
My form submissions are not working on safari either! Please help, I am able to get the insert to Database and emails that go out once they click submit just fine on other browsers just not safari!!
HELP HELP
my registration page works as planned on other browsers just not safari, Once the submit button is clicked the data is inserted into the database and an email is sent out . Neither of these features work in safari but work fine in other browsers PLEASE HELP ASAP
https://www.gamechangerzu.com/registration
Hi @hgruhot , I took a look at your code. When you click the Submit button, it tries to do two things:
-
It submits the data from all the fields into your data collection
-
It navigates to another page on your site
However , I noticed that if there is any kind of error when clicking Submit, such as a field validation error, the submission will fail but you will still navigate to the next page. There is no warning to the user that the data submission failed and because it’s already navigated to the next page, it appears that it succeeded.
In other words, I’m not sure this is a Safari-only issue…
There are a number of things you can do to mitigate this. My suggestion would be to change the Submit button so that, instead of automatically submitting the data via data binding, it uses code to accomplish the two tasks. This way, if there’s a problem with step 1, you can use code logic to warn the user and have them fix the problem before ever getting to step 2.
Check out the https://www.wix.com/code/reference/wix-dataset.Dataset.html#save and Dataset - Velo API Reference - Wix.com APIs, which you can use to accomplish the two tasks above instead of using the data binding “submit” action. In addition, when troubleshooting your site make sure you’re using the browser’s console (in developer tools) to see precisely what’s going on.
I hope this helps.
@chaim-kram What am I doing wrong for the Error code I have this for the code but get this when previewing it. PLEASE HELP, I AM SURE ITS SIMPLE
error in page code:
“The element selector function (usually $w) cannot be used before the page is ready”
Code:
$w(“#dataset1”).onError( (operation, error) => {
let errorOp = operation; // “save”
let errorCode = error.code; // “DS_VALIDATION_ERROR”
let errorMessage = error.message;
// DatasetError: Some of the elements validation failed
} );
@chaim-kram Hello, I added this to my code, the boxes now show up as red when incorrect or blank but I cannot get an error to pop up , my submit button just stays greyed out.
$w.onReady( () => {
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).save()
.then( (item) => {
let fieldValue = item.fieldName;
} )
. catch ( (err) => {
let errMsg = err;
} );
} );
$w(“#dataset1”).onError( (operation, error) => {
let errorOp = operation; // “save”
let errorCode = error.code; // “DS_VALIDATION_ERROR”
let errorMessage = error.message;
// DatasetError: Some of the elements validation failed
} );
} );
Hi there, I’m experiencing the same problem as @ghruhot who open this discussion, I’ve got wix api code which after hitting Submit button should write down some information into the database. It’s all working fine, apart from Safari browsers. I’m using lastest version, new macbook air, and it’s not working.
Has this problem been resolved? I’ve created a form, and currently loads of Apple users are complaining and It’s driving me mad. Please help !!!
Hello Chaim
I am still having this issue only on safari devices. can you look at my code again. I did make some changes but the submit button does not send the data to the database or send the email when using safari.
can you also look at mine
Hi I’ve got the same problem, any resolutions yet ?
@info80725 No unfortunately I am not getting any help in here.
I’m having the same issue as the original OP, a registration page that works perfect in Chrome and other browsers but fails in Safari. Please can you tell me if this issue was resolved or not?
@embsats NO I have not been able to get any help on this yet… Not sure why Safari would have different issues and I cannot look at my code because I do not have any apple devices to work on .
Were you able to solve this? If not please share some code (with intent and URL), and I will see if it is something I can help out with. I had tested across a large variety of browsers and devices, without any issues. Wix is strongly aligned with google and also chrome’s engine is a bit more flexible, so it may allow for certain situations to flow. Regardless, it should work.
@reveel No i have not solved this! Thanks for replying, Below is my code and the url is
https://www.gamechangerzu.com/registration
Code:
import wixLocation from ‘wix-location’;
$w.onReady( function () {
//TODO:
});
//email on submission
import {
sendEmail,
sendEmailWithRecipient
} from ‘backend/email’;
$w.onReady( function () {
$w(“#button1”).onClick(sendFormData);
// $w(“#dataset1”).onAfterSave(sendFormData);
});
//
function sendFormData() {
const subject = ${$w("#input1").value} Thank you **for** registering **with** GameChangerz University
;
const body = `${$w(“#input1”).value},
`;
const recipient = $w(“#input9”).value;
sendEmailWithRecipient(subject, body, recipient)
.then(response => console.log(response));
sendEmail(subject, body)
.then(response => console.log(response));
}
$w.onReady( () => {
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).save()
.then( (item) => {
let fieldValue = item.fieldName;
} )
. catch ( (err) => {
let errMsg = err;
} );
} );
$w(“#dataset1”).onError( (operation, error) => {
let errorOp = operation; “save”
let errorCode = error.code; “DS_VALIDATION_ERROR”
let errorMessage = error.message;
DatasetError: “Some of the elements validation failed”
} );
} );
////
export function button1_click(event, $w)
//1 on 1
//1 on 1 1 athlete
{
if (
$w(‘#dropdown7’).value === ‘1-on-1 Training’ &&
$w(‘#dropdown3’).value === ‘1’ &&
$w(‘#dropdown8’).value === ‘12 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/1on11mo1athlete”);
} else
if ($w(‘#dropdown7’).value === ‘1-on-1 Training’ &&
$w(‘#dropdown3’).value === ‘1’ &&
$w(‘#dropdown8’).value === ‘3 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/1on13mo1athletes”);
} **else**
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ &&
$w(‘#dropdown3’).value === ‘1’ &&
$w(‘#dropdown8’).value === ‘6 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/1on16mo1athlete”);
}
//small Group
//Small Group 1 athlete
else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup1mo1athlete”);
} else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup3mo1athlete”);
} **else**
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup6mo1athlete”);
}
//Small Group 2 athletes
else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup1mo2athletes”);
} else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup3mo2athletes”);
} **else**
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup6mo2athletes”);
}
//Small Group 3 athlete
else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup1mo3athletes”);
} else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup3mo3athletes”);
} **else**
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/smallgroup6mo3athletes”);
}
//Team Training
//Team 1 athlete
else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtrainig1mo1athlete”);
} else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtraining3mo1athlete”);
} **else**
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtraining6mo1athlete”);
}
//Team Training 2 athletes
else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtraining1mo2athletes”);
} else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtraining3mo2athletes”);
} **else**
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtraining6mo2athletes”);
}
//Team Training 3 athlete
else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtraining1mo3athletes”);
} else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtraining3mo3athletes”);
} **else**
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
wixLocation.to(“https://www.gamechangerzu.com/teamtraining6mo3athletes”);
}
else
wixLocation.to(“https://www.gamechangerzu.com”);
}
//choices
export function dropdown7_change(event, $w) {
// Number of Athlete Boxes:
if ($w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown3’).value === ‘2’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(),$w(‘#input20’).expand(),$w(‘#input21’).expand(), $w(‘#dropdown2’).expand(), $w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(),
$w(‘#input7’).expand(),$w(‘#input22’).expand(),$w(‘#input23’).expand(), $w(‘#dropdown4’).expand(), $w(‘#datePicker1’).expand(), $w(‘#datePicker2’).expand(),
$w(‘#dropdown13’).expand(), $w(‘#dropdown14’).expand(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(), $w(‘#dropdown5’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
else if ($w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown3’).value === ‘2’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(), $w(‘#input20’).expand(),$w(‘#input21’).expand(),$w(‘#dropdown2’).expand(), $w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(),
$w(‘#input7’).expand(),$w(‘#input22’).expand(),$w(‘#input23’).expand(), $w(‘#dropdown4’).expand(), $w(‘#datePicker1’).expand(), $w(‘#datePicker2’).expand(), $w(‘#dropdown13’).expand(),
$w(‘#dropdown14’).expand(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(), $w(‘#input24’).collapse(),$w(‘#input25’).collapse(),$w(‘#dropdown5’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
else if ($w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown3’).value === ‘3’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(),$w(‘#input20’).expand(),$w(‘#input21’).expand(), $w(‘#dropdown2’).expand(), $w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(),
$w(‘#input7’).expand(),$w(‘#input22’).expand(),$w(‘#input23’).expand(), $w(‘#dropdown4’).expand(), $w(‘#datePicker1’).expand(), $w(‘#datePicker2’).expand(), $w(‘#dropdown13’).expand(),
$w(‘#dropdown14’).expand(), $w(‘#datePicker3’).expand(), $w(‘#input8’).expand(),$w(‘#input24’).expand(),$w(‘#input25’).expand(), $w(‘#dropdown5’).expand(), $w(‘#dropdown15’).expand(), $w(‘#dropdown16’).expand();
else if ($w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown3’).value === ‘3’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(), $w(‘#input20’).expand(),$w(‘#input21’).expand(),$w(‘#dropdown2’).expand(), $w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(),
$w(‘#input7’).expand(), $w(‘#input22’).expand(),$w(‘#input23’).expand(),$w(‘#dropdown4’).expand(), $w(‘#datePicker1’).expand(), $w(‘#datePicker2’).expand(), $w(‘#dropdown13’).expand(),
$w(‘#dropdown14’).expand(), $w(‘#datePicker3’).expand(), $w(‘#input8’).expand(), $w(‘#input24’).expand(),$w(‘#input25’).expand(), $w(‘#dropdown5’).expand(), $w(‘#dropdown15’).expand(), $w(‘#dropdown16’).expand();
else if ($w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown3’).value === ‘1’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(),$w(‘#input20’).expand(),$w(‘#input21’).expand(), $w(‘#dropdown2’).expand(), $w(‘#datePicker1’).expand(),
$w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(), $w(‘#input7’).collapse(),$w(‘#input22’).collapse(),$w(‘#input23’).collapse(),
$w(‘#dropdown4’).collapse(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(),
$w(‘#dropdown5’).collapse(), $w(‘#datePicker2’).collapse(), $w(‘#dropdown13’).collapse(),
$w(‘#dropdown14’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
else if ($w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown3’).value === ‘1’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(), $w(‘#input20’).expand(),$w(‘#input21’).expand(),$w(‘#dropdown2’).expand(), $w(‘#datePicker1’).expand(),
$w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(), $w(‘#input7’).collapse(),$w(‘#input22’).collapse(),$w(‘#input23’).collapse(),
$w(‘#dropdown4’).collapse(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(),
$w(‘#dropdown5’).collapse(), $w(‘#datePicker2’).collapse(), $w(‘#dropdown13’).collapse(),
$w(‘#dropdown14’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
else if ($w(‘#dropdown7’).value === ‘1-on-1 Training’)
$w(‘#dropdown3’).collapse(),$w(‘#input19’).collapse(),$w(‘#input2’).expand(), $w(‘#input20’).expand(),$w(‘#input21’).expand(),$w(‘#dropdown2’).expand(), $w(‘#datePicker1’).expand(),
$w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(), $w(‘#input7’).collapse(),$w(‘#input22’).collapse(),$w(‘#input23’).collapse(),
$w(‘#dropdown4’).collapse(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(),
$w(‘#dropdown5’).collapse(), $w(‘#datePicker2’).collapse(), $w(‘#dropdown13’).collapse(),
$w(‘#dropdown14’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse(),$w(‘#input3’).placeholder = ‘1’;
else
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).collapse(),$w(‘#input20’).collapse(),$w(‘#input21’).collapse(), $w(‘#dropdown2’).collapse(), $w(‘#dropdown11’).collapse(), $w(‘#dropdown12’).collapse(),
$w(‘#input7’).collapse(),$w(‘#input22’).collapse(),$w(‘#input23’).collapse(), $w(‘#dropdown4’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(),
$w(‘#dropdown5’).collapse(), $w(‘#datePicker1’).collapse(), $w(‘#datePicker2’).collapse(), $w(‘#datePicker3’).collapse(), $w(‘#dropdown11’).collapse(), $w(‘#dropdown12’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
//////////////////////////////////////////////////////////////////////
////////////////////////////////////////////
//PRICING
//1 on 1
//1 on 1 1 athlete
//225 per month, 6 month gets a free month, 12 months get 3 free months —bi-weekly payment totals shown below
{
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$84.38”;
} else
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$112.50”;
} **else**
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$93.75”;
}
//small Group//10% off
//225 per month, 6 month gets a free month, 12 months get 3 free months
//Small Group 1 athlete
//2 to 5 players//
else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$75.94”;
} else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$101.25”;
} **else**
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “84.38”;
}
//Small Group 2 athletes
else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$151.88”;
} else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$202.50”;
} **else**
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$168.50”;
}
//Small Group 3 athlete
else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$227.82”;
} else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$303.75”;
} **else**
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$253.13”;
}
//Team Training
//Team 1 athlete
//15% off
//225 per month, 6 month gets a free month, 12 months get 3 free months //6 or more athletes
else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$71.72”;
} else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$95.63”;
} **else**
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$79.69”;
}
//Team Training 2 athletes
else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$143.44”;
} else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$191.25”;
} **else**
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$159.38”;
}
//Team Training 3 athlete
else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$215.16”;
} else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$286.88”;
} **else**
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$239.07”;
}
}}
// Allergies text box on yes
$w.onReady( function () {
//TODO:
});
export function radioGroup1_change(event, $w) {
if ($w(‘#radioGroup1’).value === ‘Yes’)
$w(‘#textBox1’).expand(), $w(‘#text8’).expand();
else if ($w(‘#radioGroup1’).value === ‘No’)
$w(‘#textBox1’).collapse(), $w(‘#text8’).collapse();
}
// Inhaler text box on yes
$w.onReady( function () {
//TODO:
});
export function radioGroup2_change(event, $w) {
if ($w(‘#radioGroup2’).value === ‘Yes’)
$w(‘#textBox2’).expand(), $w(‘#text10’).expand();
else if ($w(‘#radioGroup2’).value === ‘No’)
$w(‘#textBox2’).collapse(), $w(‘#text10’).collapse();
}
///////////////////////////////PRICING CHANGES SECTION/////////////////////////////////////////////////
export function dropdown8_change(event, $w) {
////////////////////////////////////////////
//PRICING
//1 on 1
//1 on 1 1 athlete
//225 per month, 6 month gets a free month, 12 months get 3 free months —bi-weekly payment totals shown below
{
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$84.38”;
} else
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$112.50”;
} **else**
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$93.75”;
}
//small Group//10% off
//225 per month, 6 month gets a free month, 12 months get 3 free months
//Small Group 1 athlete
//2 to 5 players//
else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$75.94”;
} else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$101.25”;
} **else**
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “84.38”;
}
//Small Group 2 athletes
else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$151.88”;
} else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$202.50”;
} **else**
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$168.50”;
}
//Small Group 3 athlete
else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$227.82”;
} else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$303.75”;
} **else**
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$253.13”;
}
//Team Training
//Team 1 athlete
//15% off
//225 per month, 6 month gets a free month, 12 months get 3 free months //6 or more athletes
else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$71.72”;
} else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$95.63”;
} **else**
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$79.69”;
}
//Team Training 2 athletes
else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$143.44”;
} else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$191.25”;
} **else**
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$159.38”;
}
//Team Training 3 athlete
else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$215.16”;
} else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$286.88”;
} **else**
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$239.07”;
}
}
}
//////////////////
export function dropdown3_change(event)
////////////////////////////////////////////
//PRICING
//1 on 1
//1 on 1 1 athlete
//225 per month, 6 month gets a free month, 12 months get 3 free months —bi-weekly payment totals shown below
{
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$84.38”;
} else
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$112.50”;
} **else**
if ( $w(‘#dropdown7’).value === ‘1-on-1 Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$93.75”;
}
//small Group//10% off
//225 per month, 6 month gets a free month, 12 months get 3 free months
//Small Group 1 athlete
//2 to 5 players//
else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$75.94”;
} else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$101.25”;
} **else**
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “84.38”;
}
//Small Group 2 athletes
else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$151.88”;
} else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$202.50”;
} **else**
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$168.50”;
}
//Small Group 3 athlete
else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$227.82”;
} else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$303.75”;
} **else**
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$253.13”;
}
//Team Training
//Team 1 athlete
//15% off
//225 per month, 6 month gets a free month, 12 months get 3 free months //6 or more athletes
else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$71.72”;
} else
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$95.63”;
} **else**
if ($w(‘#dropdown3’).value === ‘1’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$79.69”;
}
//Team Training 2 athletes
else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$143.44”;
} else
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$191.25”;
} **else**
if ($w(‘#dropdown3’).value === ‘2’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$159.38”;
}
//Team Training 3 athlete
else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘12 Month Commitment’) {
$w(‘#input18’).placeholder = “$215.16”;
} else
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘3 Month Commitment’) {
$w(‘#input18’).placeholder = “$286.88”;
} **else**
if ($w(‘#dropdown3’).value === ‘3’ && $w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown8’).value === ‘6 Month Commitment’) {
$w(‘#input18’).placeholder = “$239.07”;
}
// Number of Athlete Boxes:
// Number of Athlete Boxes:
if ($w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown3’).value === ‘2’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(),$w(‘#input20’).expand(),$w(‘#input21’).expand(), $w(‘#dropdown2’).expand(), $w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(),
$w(‘#input7’).expand(), $w(‘#input22’).expand(),$w(‘#input23’).expand(),$w(‘#dropdown4’).expand(), $w(‘#datePicker1’).expand(), $w(‘#datePicker2’).expand(),
$w(‘#dropdown13’).expand(), $w(‘#dropdown14’).expand(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(), $w(‘#dropdown5’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
else if ($w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown3’).value === ‘2’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(),$w(‘#input20’).expand(),$w(‘#input21’).expand(), $w(‘#dropdown2’).expand(), $w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(),
$w(‘#input7’).expand(), $w(‘#input22’).expand(),$w(‘#input23’).expand(),$w(‘#dropdown4’).expand(), $w(‘#datePicker1’).expand(), $w(‘#datePicker2’).expand(), $w(‘#dropdown13’).expand(),
$w(‘#dropdown14’).expand(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(), $w(‘#input24’).collapse(),$w(‘#input25’).collapse(),$w(‘#dropdown5’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
else if ($w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown3’).value === ‘3’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(),$w(‘#input20’).expand(),$w(‘#input21’).expand(), $w(‘#dropdown2’).expand(), $w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(),
$w(‘#input7’).expand(), $w(‘#input22’).expand(),$w(‘#input23’).expand(),$w(‘#dropdown4’).expand(), $w(‘#datePicker1’).expand(), $w(‘#datePicker2’).expand(), $w(‘#dropdown13’).expand(),
$w(‘#dropdown14’).expand(), $w(‘#datePicker3’).expand(), $w(‘#input8’).expand(),$w(‘#input24’).expand(),$w(‘#input25’).expand(), $w(‘#dropdown5’).expand(), $w(‘#dropdown15’).expand(), $w(‘#dropdown16’).expand();
else if ($w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown3’).value === ‘3’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(),$w(‘#input20’).expand(),$w(‘#input21’).expand(),$w(‘#dropdown2’).expand(), $w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(),
$w(‘#input7’).expand(), $w(‘#input22’).expand(),$w(‘#input23’).expand(),$w(‘#dropdown4’).expand(), $w(‘#datePicker1’).expand(), $w(‘#datePicker2’).expand(), $w(‘#dropdown13’).expand(),
$w(‘#dropdown14’).expand(), $w(‘#datePicker3’).expand(), $w(‘#input8’).expand(), $w(‘#input24’).expand(),$w(‘#input25’).expand(),$w(‘#dropdown5’).expand(), $w(‘#dropdown15’).expand(), $w(‘#dropdown16’).expand();
else if ($w(‘#dropdown7’).value === ‘Team Training’ && $w(‘#dropdown3’).value === ‘1’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(), $w(‘#input20’).expand(),$w(‘#input21’).expand(),$w(‘#dropdown2’).expand(), $w(‘#datePicker1’).expand(),
$w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(), $w(‘#input7’).collapse(),$w(‘#input22’).collapse(),$w(‘#input23’).collapse(),
$w(‘#dropdown4’).collapse(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(),
$w(‘#dropdown5’).collapse(), $w(‘#datePicker2’).collapse(), $w(‘#dropdown13’).collapse(),
$w(‘#dropdown14’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
else if ($w(‘#dropdown7’).value === ‘Small Group Training’ && $w(‘#dropdown3’).value === ‘1’)
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).expand(),$w(‘#input20’).expand(),$w(‘#input21’).expand(), $w(‘#dropdown2’).expand(), $w(‘#datePicker1’).expand(),
$w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(), $w(‘#input7’).collapse(),$w(‘#input22’).collapse(),$w(‘#input23’).collapse(),
$w(‘#dropdown4’).collapse(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(),
$w(‘#dropdown5’).collapse(), $w(‘#datePicker2’).collapse(), $w(‘#dropdown13’).collapse(),
$w(‘#dropdown14’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
else if ($w(‘#dropdown7’).value === ‘1-on-1 Training’)
$w(‘#dropdown3’).collapse(),$w(‘#input19’).collapse(),$w(‘#input2’).expand(), $w(‘#input20’).expand(),$w(‘#input21’).expand(),$w(‘#dropdown2’).expand(), $w(‘#datePicker1’).expand(),
$w(‘#dropdown11’).expand(), $w(‘#dropdown12’).expand(), $w(‘#input7’).collapse(),$w(‘#input22’).collapse(),$w(‘#input23’).collapse(),
$w(‘#dropdown4’).collapse(), $w(‘#datePicker3’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(),
$w(‘#dropdown5’).collapse(), $w(‘#datePicker2’).collapse(), $w(‘#dropdown13’).collapse(),
$w(‘#dropdown14’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse(),$w(‘#input3’).placeholder = ‘1’;
else
$w(‘#dropdown3’).expand(),$w(‘#input19’).expand(),$w(‘#input2’).collapse(), $w(‘#input20’).collapse(),$w(‘#input21’).collapse(),$w(‘#dropdown2’).collapse(), $w(‘#dropdown11’).collapse(), $w(‘#dropdown12’).collapse(),
$w(‘#input7’).collapse(),$w(‘#input22’).collapse(),$w(‘#input23’).collapse(), $w(‘#dropdown4’).collapse(), $w(‘#input8’).collapse(),$w(‘#input24’).collapse(),$w(‘#input25’).collapse(), $w(‘#dropdown5’).collapse(), $w(‘#datePicker1’).collapse(), $w(‘#datePicker2’).collapse(), $w(‘#datePicker3’).collapse(), $w(‘#dropdown11’).collapse(), $w(‘#dropdown12’).collapse(), $w(‘#dropdown15’).collapse(), $w(‘#dropdown16’).collapse();
}
/////hide submit button
$w.onReady( function () {
$w(‘#input1’).onChange(formChanged)
$w(‘#input2’).onChange(formChanged)
$w(‘#input4’).onChange(formChanged)
$w(‘#input3’).onChange(formChanged)
$w(‘#input5’).onChange(formChanged)
$w(‘#input9’).onChange(formChanged)
$w(‘#input6’).onChange(formChanged)
$w(‘#input10’).onChange(formChanged)
$w(‘#input11’).onChange(formChanged)
$w(‘#dropdown1’).onChange(formChanged)
$w(‘#dropdown3’).onChange(formChanged)
$w(‘#input19’).onChange(formChanged)
$w(‘#dropdown2’).onChange(formChanged)
$w(‘#dropdown11’).onChange(formChanged)
$w(‘#dropdown10’).onChange(formChanged)
$w(‘#input12’).onChange(formChanged)
$w(‘#input13’).onChange(formChanged)
$w(‘#input4’).onChange(formChanged)
$w(‘#input15’).onChange(formChanged)
$w(‘#input16’).onChange(formChanged)
$w(‘#input17’).onChange(formChanged)
$w(‘#input12’).onChange(formChanged)
$w(‘#dropdown7’).onChange(formChanged)
$w(‘#dropdown8’).onChange(formChanged)
$w(‘#radioGroup1’).onChange(formChanged)
$w(‘#radioGroup2’).onChange(formChanged)
$w(‘#datePicker1’).onChange(formChanged)
});
function formChanged() {
const input1valid = $w(‘#input1’).valid
const input7valid = $w(‘#input7’).valid
const input8valid = $w(‘#input8’).valid
const input2valid = $w(‘#input2’).valid
const input4valid = $w(‘#input4’).valid
const input3valid = $w(‘#input3’).valid
const input5valid = $w(‘#input5’).valid
const input9valid = $w(‘#input9’).valid
const input6valid = $w(‘#input6’).valid
const input10valid = $w(‘#input10’).valid
const input11valid = $w(‘#input11’).valid
const dd1valid = $w(‘#dropdown1’).valid
const dd3valid = $w(‘#dropdown3’).valid
const input19valid = $w(‘#input19’).valid
const dd2valid = $w(‘#dropdown2’).valid
const dd11valid = $w(‘#dropdown11’).valid
const dd10valid = $w(‘#dropdown10’).valid
const input12valid = $w(‘#input12’).valid
const input13valid = $w(‘#input13’).valid
const input14valid = $w(‘#input14’).valid
const input15valid = $w(‘#input15’).valid
const input16valid = $w(‘#input16’).valid
const input17valid = $w(‘#input17’).valid
const input18valid = $w(‘#input18’).valid
const input20valid = $w(‘#input20’).valid
const input21valid = $w(‘#input21’).valid
const input22valid = $w(‘#input22’).valid
const input23valid = $w(‘#input23’).valid
const input24valid = $w(‘#input24’).valid
const input25valid = $w(‘#input25’).valid
const dd7 = $w(‘#dropdown7’).valid
const dd8 = $w(‘#dropdown8’).valid
const dd4 = $w(‘#dropdown4’).valid
const dd5 = $w(‘#dropdown5’).valid
const dd10 = $w(‘#dropdown10’).valid
const dd11 = $w(‘#dropdown11’).valid
const dd12 = $w(‘#dropdown12’).valid
const dd13 = $w(‘#dropdown13’).valid
const dd14 = $w(‘#dropdown14’).valid
const dd15 = $w(‘#dropdown15’).valid
const dd16 = $w(‘#dropdown16’).valid
const dd17 = $w(‘#dropdown17’).valid
const rr1 = $w(‘#radioGroup1’).valid
const rr2 = $w(‘#radioGroup2’).valid
const date1 = $w(‘#datePicker1’).valid
const date2 = $w(‘#datePicker2’).valid
const date3 = $w(‘#datePicker3’).valid
const isFormValid = input1valid && input2valid &&input3valid && input4valid && input5valid &&
input6valid && input7valid &&input8valid && input9valid && input10valid && input11valid && input12valid & input13valid &&
input14valid && input15valid && input16valid && input17valid
&& input18valid && input19valid && input20valid && input21valid&& input22valid&& input23valid && input24valid && input25valid
&& dd10valid && dd11valid && dd12 && dd13 && dd14 && dd15 && dd16 && dd17
&& dd10valid && dd11valid && dd4 && dd2valid && dd5
&& dd7 && dd8 && rr1 && rr2 && date1 && date2 && date3
if (isFormValid) {
($w(‘#button1’).enable() && $w(‘#text45’).hide());
} else {
($w(‘#button1’).disable() && $w(‘#text45’).show())
}
}
// Inhaler text box on yes
$w.onReady( function () {
if ($w(‘#button1’).enable )
$w(‘#text45’).show();
else if ($w(‘#button1’).disable )
$w(‘#text45’).hide();
}
)
Just some initial questions for you.
-
Have you placed all this code on the front end? - for that one page: https://www.gamechangerzu.com/registration . I ask because I see 2 imports in 2 places and can’t tell if you pasted multiple-files or one file in this post. Additionally, when I went online to see the real exposed frontend code, this code (supplied in this post) didn’t show up – meaning, I cannot find this code within the source-pages online. Therefore, I can’t truly pin point without knowing/seeing that. Although, I will point out the biggest thing I noticed in #2 below.
-
Using Wix’s ’ $w.onReady() ’ function is very useful for front end code, since it will handle code once the page is loaded, which means the browser is ready too. In this case that would be suggested to place your page’s active/UX type code within that block or call it from that block. Therefore, then you’d have to tie your page’s UI inside or from there. That is why a suggestion would be to use code that would resemble this (inside): " $w(“#myElement”).onClick( (event) => {}); " instead of exporting a button click function (just as an example).
Mainly investigate refactoring your code to utilize what I mentioned in #2. The Wix API Reference details all this. It is common sometimes when reading docs, that you may have to read it more than once to catch everything. https://www.wix.com/corvid/reference/$w.html#onReady
Also, I noticed some deprecated code usage too. See this link from a 2018-07-17 deprecation notice: https://www.wix.com/corvid/forum/corvid-tips-and-updates/removal-of-the-w-parameter-from-event-handlers . Although I’d still suggest using the strategy suggested in #2.
@reveel I am new to this coding so it probably does have a lot of issues, as I learned through Google how to do all the things my page is doing. How do I put it on the source page? yes the code is all on the one page.
@hgruhot
Here is a link for a full tutorial by Wix for Corvid: https://support.wix.com/en/article/getting-started-with-corvid-by-wix
My question for the source code, was regarding the code you supplied, since it was not showing up in the browser. As a reminder that frontend code is downloaded to the browser - and I was not able to see it.
Basically (normally/wix) the code for your UI is connected on the frontend. When your page loads, then that is when you can (should) take actions on your code. So first try utilizing the ’ $w.onReady() ’ function I mentioned.
Some other/minor suggestions:
-
Place your problem in its own post, to keep it clean and help future visitors too. You can mention me there. I wont be that active as of Monday for about 3 weeks, but I will try to check in.
-
Break up your flow up into smaller chunks, which should make your code easier to manage, but moreover that your UX is improved. It is your business; so you know better, but the norm for UX is not to overwhelm the user/visitor all at once.
-
Even pros use google to get help here and there. Coding isn’t hard, but for some, knowing the baseline/basics tends to get in the way - so you may want to grasp that first. There are plenty of online courses. Additionally, and which is based on your business needs, you may want to hire someone. Wix offers that too - I am not part of that (I’m just a fellow Wix site owner), but giving you an FYI to speed things up.
P.S. I offer my time to help because as a coder I feel it is the right thing to do, and one day you’ll be able to do the same - stay positive. You’ve come this far learning on your own; it’s all an information/learning journey.