I would like to get the total price based on price * quantity . I need a function in order to do this. Here is currently what I'm working on right now

@mtf it is still the same and it is not working.

Was it Einstein who said that insanity is doing the same thing over an over and expecting different results? Until the code is revised we can’t know if it will work. Forget why it doesn’t work. Fix it.

@mtf so, is it just minor mistakes that I made or do I have to add something else?

No, minor. Move the script. Let us know what happens.

@mtf, done it but is still not working. I think there are more issues in this document.

Did you validate the HTML, yet? Where is the script now written? We need to see the revised code.

@mtf done the validation. there are some mistakes on HTML but that does not necessarily affect the code. I think there is something wrong with the Javascript section.

Until now I hadn’t noticed the FORM attributes, my bad. This code should run without a server-side handler so the action would be, action="" and the method attribute could be left off.

<form action="">

The results will be displayed in real time on the client side.

@mtf, the results are still the same. No changes

Time to see the code you’re running, again. Please format for posting.

@mtf, so should I send the entire code again?

Yes, please. Formatted for posting.

@mtf, I’m done with the formatting. U can go ahead and take a look at the formatted code above now.

Script at the start of the body, or before cannot hook onto page elements because they have not loaded yet. Put the script at the end of the body.

You should know that you also wasted twenty minutes of my time formatting your post by completely destroying it. I cannot help with this any longer. Stop tagging me in.

You want someone to give you a solution that is bound to be over your head but you still believe you can learn from it. Ain’t going to happen. There are concepts that you are not even aware of that are in play here. Stop playing games and go back to learning basics. Then return to this project when you actually understand the DOM.

And it would help if you learn how to post code in the forum.

@mtf, I’m really sorry. I didn’t mean it in any ill will or bad intentions. I’m just a beginner in coding and this is my first time posting in this forum so I might not be aware on certain procedures. Also, to reply to your comment about I should start learning from basics, the truth is I’m learning basic right now but i have been assign with this project so it is really difficult for me. However, like I say, I’m really sorry if I hurt your feelings.

Stop trying to jump the queue. You want to learn? Then do the due diligence in the wading pool, and then the shallow end. Basics. Don’t skip the basics and practice until you drop. So many learners expect so much without investing themselves. Don’t be one of them. If you want this, then start at the beginning and go slow, with lots of reps. There is too much to learn to skip this step. It cannot be done.

@mtf, thanks for the advice. Also, it would be great if you can leave me a comment on what I can further improve on posting questions on the forum.

1 Like

There is a new user section that details how to post. One would expect formatting code samples to be among them. If you cannot find them, let me know. I’ll search for you.

@mtf I found a page on Codecademy on how to post FAQ. However, the page is not detailed in terms on how to post a question properly. So, I suggest if u could help me on that.

1 Like

Hello! Here is a thread which explains the best ways to ask good questions.

2 Likes