r/JavaScriptHelp • u/Wheresjennow • Dec 06 '21
❔ Unanswered ❔ JS/Jquery Radio Button & Text Box Selection
I'm very new to JS and am working on a site with code I didn't write, but am trying to correct. Here's how to get to what I'm looking at:
Go to FS Shop
Add anything to your cart and go to to the Checkout Page.
Scroll to the bottom and click the Continue button.
A donation modal will pop up.
When you click the text box for the "Enter Amount" option, the radio button is not filled.
If you click that radio button, the curser does not move to the text box.
If you select one of the other amounts like $50 and then click the text box to enter $5, the radio button for $50 stays filled.
You can see that when you click the text box, the associated radio button blinks quickly so something is happening, but not the correct thing.
The 3 main files for this are:
checkout.js
donation.js
jquery-donation.js
When I copy the code from jquery-donation.js to the browser console, it works correctly. However, it doesn't work with the file simply added to the bottom of the page. jquery-donation.js is found, but not working.
There seems to be a conflict or something between this file and checkout.js.
Is anyone able to provide some guidance? I'd be super appreciative to learn how to fix this. TYIA!
Edit: Clarified description
1
u/sandybuttcheekss Dec 07 '21
Did you include it in a script tag?