I’m a total JavaScript novice–I took one basic java scripting class on line. Its all guessing from there.
I’m trying to create an HTML form and then runs a java script that feeds back pricing based on the user’s selection of member ship status. The class I took showed ow to get user input from a window prompt, but this is just not practical.
I try to go piece by piece when doing new things. Once i get the first step down, I move on the next.
I’d LOVE help on this particular project, but more importantly, I’d love to get suggestions for books on online classes to help me develop these skills further.
Thanks
Mary Ellen
here’s my code:
<p>
<input type=”checkbox” name=”status” value=”1″>
I am a NACE member</p>
<script language=”JavaScript” >
// running list of nace products for the order form
//match array id numbers with member non member pricing based on user input
//calculate cost using simple math of user input variable times cost
product = new Array(3);
product[0] = “2004 Employer Benchmark Survey: College Recruiting Status Report 330410BS”;
product[1] = “2004 Experiential Education Survey Report 330404EE”;
product[2] = “2004 National Meeting CD-ROM 26040CD”;
memprice = new Array(3);
memprice[0] =”39.95″;
memprice[1] = “75.00”;
memprice[2] = “129.00”;
nonmemprice = new Array(3);
nonmemprice[0] =”69.95″;
nonmemprice[1] = “150.00”;
nonmemprice[2] = “199.00”;
//set the counter to zero
var counter = 0;
//continue through the lenght of the product array
while (counter < product.length)
//test to see if nacemember selected and set the price based on status
var price
if (status != 1)
price =memprice[counter]
else price = nommemprice[counter];
{
document.write (“<p>Item: “, product[counter], ” Cost: $”, memprice[counter], “.</p>”);
document.write (“<p> price value: “, price, “</p>”);
counter++;
}
</script>