Help help help
Nov. 10th, 2006 02:36 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Yes, I'm coming to my flist for homework help.
This is for my Web Programming class, learning XHTML.
Assignment is: Create a JavaScript program that calculates an employee's weekly gross salary, based on the number of hours worked and hourly wage entered by the user. Compute any hours over 40 as time-and-a-half. Display the results in an alert dialog box. Save the file as Wages.html.
Okay, I did all of that. The damn file validated at http://validator.w3.org like it was supposed to. But when I open the page in my browser (tried both IE and Firefox) and enter the info and click on the button, it tells me 'script error'. I can't figure out what I did wrong because the other file I did that was almost exactly like it, works.
Here's what I have:

Help?
This is for my Web Programming class, learning XHTML.
Assignment is: Create a JavaScript program that calculates an employee's weekly gross salary, based on the number of hours worked and hourly wage entered by the user. Compute any hours over 40 as time-and-a-half. Display the results in an alert dialog box. Save the file as Wages.html.
Okay, I did all of that. The damn file validated at http://validator.w3.org like it was supposed to. But when I open the page in my browser (tried both IE and Firefox) and enter the info and click on the button, it tells me 'script error'. I can't figure out what I did wrong because the other file I did that was almost exactly like it, works.
Here's what I have:
Help?
(no subject)
Date: 2006-11-10 11:16 pm (UTC)(no subject)
Date: 2006-11-11 04:05 am (UTC)More specifically, the root of the problem is that your JavaScript code believes that the name of the form in the document is "salary", while the document itself names the form "wages". Pick one or the other and make them all match, and I think you'll find that everything else is just fine.