Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,214 members, 7,818,725 topics. Date: Sunday, 05 May 2024 at 11:07 PM

Learner Here: Please Help Me Fix My Code - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Learner Here: Please Help Me Fix My Code (512 Views)

Please, is this okay for a learner? / Please Someone Help Me Fix My Facebook Account / Please Help Look At My Code (what is wrong with my code ) (2) (3) (4)

(1) (Reply) (Go Down)

Learner Here: Please Help Me Fix My Code by Mathemagician1(m): 9:37pm On Feb 07, 2023
.
Re: Learner Here: Please Help Me Fix My Code by Mathemagician1(m): 9:37pm On Feb 07, 2023
.
Re: Learner Here: Please Help Me Fix My Code by LittleBigDick(m): 5:06am On Feb 08, 2023
Paste this in paste bin and post the link here

1 Like

Re: Learner Here: Please Help Me Fix My Code by chukwuebuka65(m): 12:11pm On Feb 08, 2023
Which part is not working? Calculating total price or submitting to payment processor?
Re: Learner Here: Please Help Me Fix My Code by Nobody: 5:58pm On Feb 08, 2023
What payment gateway are using.

Also, if you're using Ajax to process the submitted form data, you need to prevent the default behavior of the form that is, stopping the form from reloading your page if not your entire JavaScript wont run as you expect on when you click the submit button:
Re: Learner Here: Please Help Me Fix My Code by Mathemagician1(m): 10:28pm On Feb 08, 2023
.
Re: Learner Here: Please Help Me Fix My Code by beardedboy(m): 6:04am On Feb 09, 2023
Mathemagician1:






Here's my codepen. I want to be able to call the unit price and total cost from the function. I also want to be able to click the pay now bottom and be redirected to a payment processor like paystack.

https://codepen.io/rudedough1/pen/vYawJzm
Honestly, your code is quite messy.

1. Please remove all that table html. Use CSS to style your code.

2. Move the JavaScript to the JS section of codepen. Don't put it in a script tag.
Read more about "separation of concerns" in web development. A messy code is uninspiringly difficult to read.

3. Stop the act of creating helper functions for simple/basic things. Stick to the getElementById functions. They're easier to read.

4. Now, to your question. What do you mean by "call" unit price and cost price function?

(1) (Reply)

Can One Become A Software Engineer And Also Devops engineer? / I Designed And Published This Python Package In 8days. Check It Out / Product (UI/UX) Designer

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.