Home › Forums › Support › Input sum not working with javascript + GP hooks This topic has 7 replies, 3 voices, and was last updated 7 years ago by Tom. Viewing 8 posts - 1 through 8 (of 8 total) Author Posts September 14, 2017 at 12:23 pm #385519 Tyler Hey Tom, I need help, can you please tell me what I am doing wrong? Here is the code I used: http://jsfiddle.net/markwylde/gjz9h/ Here is the page I am working on: http://www.muhrprofessionalbuildings.com/wp/comparison/ And an image of what my javascript looks like inside your GP hook section. Thank you! September 14, 2017 at 3:09 pm #385597 LeoStaff Customer Support Hi there, Does it work without the if condition? September 18, 2017 at 10:25 am #387491 Tyler Hey Leo, I get an error if I take away the “IF”. https://imgur.com/a/5l7Hc September 18, 2017 at 12:55 pm #387569 LeoStaff Customer Support I meant the entire IF statement. So basically only paste the <script></script> September 18, 2017 at 1:16 pm #387591 Tyler Hey Leo, Unfortunately, it still doesn’t work 🙁 I think I had it as only the script prior to finding a forum where Tom mentioned having that PHP in there and it worked for the customer. https://generatepress.com/forums/topic/using-custom-javascript-in-a-page/ September 18, 2017 at 7:19 pm #387706 TomLead Developer Lead Developer Replace this: $( document ).ready( function() { With this: jQuery( document ).ready( function($) { September 20, 2017 at 8:40 am #388839 Tyler Hey Tom, Thank you, it definitely did something, but it doesn’t show the total value it just makes the “0” disappear. http://www.muhrprofessionalbuildings.com/wp/comparison/ You can see it here, until I get it working I have it only set up with the first two boxes. The others are inputs for numbers. On the final row is where I have the total and in the second column it has the sum displayed. September 20, 2017 at 8:50 pm #389148 TomLead Developer Lead Developer Hmm, I can’t see why it wouldn’t work. The jQuery itself makes sense and should work fine. There might be other factors at play though – plugins, HTML etc.. It’s hard for me to tell unfortunately. Author Posts Viewing 8 posts - 1 through 8 (of 8 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In