javascript adding multiple variables to mailto body with a for loop -


this function below supposed add of variables "mess" body of email message. "who" , "what" gets read in email address , subject ok, , first line of mess variables "isbn" gets read body should...but rest of mess variables should read body not entered. wondering if loop not looping correctly. trying narrow problem down. nice.

function mailorder() {    who=document.order.email.value;    what="order";    var mess = "";    (var n = 0; n < bookdb.length; n++)     {     booknum = bookdb[n].quantity;     if (booknum > 0)         {               mess += "isbn: " + bookdb[n].number + "&nbsp;&nbsp;&nbsp;";        mess += "book name: " + bookdb[n].title + "&nbsp;&nbsp;&nbsp;";        mess += "quantity ordered: " + bookdb[n].quantity + "&nbsp;&nbsp;&nbsp;";        mess += "book price: " + bookdb[n].price + "&nbsp;&nbsp;&nbsp;";        mess += " ***************************************************** ";        }            }    mess +="customer name: " + document.order.name.value + "&nbsp;&nbsp;&nbsp;";    mess +="email address: " + document.order.email.value + "&nbsp;&nbsp;&nbsp;";    mess +="address: " + document.order.address.value + "&nbsp;&nbsp;&nbsp;";    mess +="city: " + document.order.city.value + "&nbsp;&nbsp;&nbsp;";    mess +="country: " + document.order.country.value + "&nbsp;&nbsp;&nbsp;";     parent.location.href='mailto:'+who+'?subject='+what+'&body='+mess; } 


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

rest - Spring boot: Request method 'PUT' not supported -