I added an html element on wix product page via custom code. Here is my code
If you check this product page https://www.theplannerexchange.com/product-page/ you can see it’s showing on load but after it’s disappear automatically. What is the wrong i have done? Please someone tell me.
The thing i need on product page is when anyone select Rent from the dropdown there will be add a checkbox and if the checkbox is not checked the add to card button will be disable. I need help from Wix code expert. Please help me.
can you show it in screenshots so we have a better idea of the problem. e.g. an image of it working (or what you want to achieve) and an image of it not working
If you visit this page https://www.theplannerexchange.com/product-page/ you can see on load the the checkbox showing but after that it’s automatically removing.
I added the element via jquery before the add to cart button. It’s showing on load. After loading the page the element auto remove.
could you show me an image of this checkbox is it the “are you over 18” input?
nvm ye it is ok.
so you don’t need jQuery to add this checkbox you can just add it in through wix and have an onchange event listener on your rent button
The age button is collapsed on default and expands when the onChange finds that the user has selected “Rent”. when the user selects “Rent” you can change the “Age Checkbox”.required to true and else it is set to false
I haven’t found any selector for the Rent button. Also the age checkbox need to create via code. How can i do that all process via wix code. There have no proper documentation. Can you give me an example code so i can get idea what i need to do. Also i have not found any reason why Wix remove jquery code. You can check this screenshot https://drive.google.com/file/d/1Hrhx-NGC61VY6fIRmlwKOzArO4VReKyH/view You can see on loading the text showing but after finish loading it’s removed automatically. I added this text via jquery insertAfter method.
I haven’t found any selector for the Rent button. Also the age checkbox need to create via code. How can i do that all process via wix code. There have no proper documentation. Can you give me an example code so i can get idea what i need to do. Also i have not found any reason why Wix remove jquery code. You can check this screenshot https://drive.google.com/file/d/1Hrhx-NGC61VY6fIRmlwKOzArO4VReKyH/view You can see on loading the text showing but after finish loading it’s removed automatically. I added this text via jquery insertAfter method.
that should do what you want:
here is what happens:
Nothing selected:
Rent Selected

Buy Selected

Oh i already know that what you just share. Do you try it on wix product page. Do you try it with product options. The dropdown is product options and there have no option to create checkbox on a wix product page.