This code is the javascript for only one part of the site that I am creating for work. What I need this to do is accept input from the user about information that must be approved at a later time. the information is set in a form and needs to be approved later in the day by a supervisor. What I need is help with the code. it is not pulling information into the text area the way I need it to. This is the biggest thing that I need help with. please let me know where the issue/s are so that I may resolve them quickly.
<script type="text/javascript">
var x = document.getElementById(price).value;
var y = document.getElementById(disc).value;
function newDevice(){
var namebox = document.getElementById('cust').value;
var makebox = document.getElementById('make').value;
var mdnbox = document.getElementById('mdn').value;
var pricebox = document.getElementById('price').value;
var discbox = document.getElementById('disc').value;
var costbox = document.getElementById('cost').value;
var mirbox = document.getElementById('mir').value;
var insbox = document.getElementById('insurance').value;
var accbox = document.getElementById('acc').value;
var accpbox = document.getElementById('accp').value;
var ship = document.getElementById('ship').value;
var remarksbox = document.getElementById('Remarks').value;
remarksbox.value = "Customer: " + namebox.value +", requested " + makebox.value + ", for a new 2 year contract on MDN: " + mdnbox.value + " for the price of $" + pricebox.value + " and a discount of: $" + discbox.value + ". The total cost of the equipment is $" + costbox.value + " with an Mail in Rebate of: $" + mirbox.value + ". " + namebox.value +" has " + insbox.value + " Insureance. " + namebox.value + " has requested " + accbox.value + " for a total of $" + accpbox.value + ". The order is shipping via: " + shipbox.value + ". Full disclosures have been provided."
}
</script>
</head>
<body bgcolor="ivory">
<table border="1">
<!--//Header-->
<tr>
<td>New Device</td>
<td>CLNR</td>
<td>Accessory</td>
</tr>
<tr>
<!--//New Device Body-->
<td><form name="New">
<table><tr><td valign"right">
<tr><td>Name:</td><td><input id=cust onfocus="if(this.value=='Name'){this.value='';}" value="Name"></td></tr>
<tr><td>Make/Model:</td><td><input id="make" onfocus="if(this.value=='Device SKU'){this.value='';}" value="Device SKU"></td></tr>
<tr><td>Contract Term:</td><td>2 year contract</td></tr>
<tr><td>MDN:</td><td><input id=mdn onfocus="if(this.value=='MDN'){this.value='';}" value="MDN"></td></tr>
<tr><td>Price:</td><td><input id=price onfocus="if(this.value=='Price'){this.value='';}" value="Price"></td></tr>
<tr><td>Discount Amount:</td><td><input id=disc onfocus="if(this.value=='Discount'){this.value='';)" value="Discount"></td></tr>
<tr><td>Cost of Equipment:</td><td><script>document.write(x-y);</script></td></tr>
<tr><td>MIR Amount:</td><td><input id=mir onfocus="if(this.value='Mail in Rebate'){this.value='';}" value="Mail in Rebate"></td></tr>
<tr><td>Insurance:</td><td><select name="insurance" id=insurance><option value="TEC">TEC</option><option value="WPP">WPP</option><option value="EW">EW</
option><option vlue="Declined">Declined</option></select></td></tr>
<tr><td>Accessories:</td><td><input id=acc onfocus="if(this.value=='Accessories'){this.value='';}" value="Accessories"></td></tr>
<tr><td>Total Accessories price:</td><td><input id="accp" type="number" name="Acc Price" value="Price"></td></tr>
<tr><td>Shipped Via:</td><td><select name="shipping" id=ship><option value="FedEx">FedEx</option><option value="USPS">USPS</option></select></td></tr>
<!--//Button-->
<tr><td colspan=2><button onclick=newDevice();>Click to copy New Device Remarks</button></td></tr>
</table></form></td>
<td><textarea id=Remarks onclick=javascript:this.focus();this.select(); rows=15 cols=30>Click Generate to show your remarks here!</textarea></td></tr>