HTML code:
<form id="hostadd" action="addmoney.php?taskid=12" method="post" onSubmit="return false">
<input type="hidden" name="mode" value="" />
current unit price:$
<input id="unitprice" name="unitprice" type="text" size="5" maxlength="6" value= 0.50 /> 
Shortfall:<input id="shortfall" type="text" name="shortfall" size="4" maxlength="6" value=80 />
<input id="add_price" type="submit" value="Submit" onclick="Adjust()"/></form
Jquery code:
function Adjust(){
$totalprice=parseFloat($('unitprice').val())*parseInt($('shortfall').val());
alert($totalprice);
};
When I test
var unitPrice = $('#unitprice').val();
alert(unitPrice);
var shortFall = $('#shortfall').val();
alert(shortFall);
I got two blank alerts.
You’re looking for an HTML ‘shortfall’ and ‘unitprice’:
Do you mean to do this? Maybe your after a class or ID selctor?
Try looking at each individual component to see which is failing.
Also, pass the radix to parseInt() (note: below I assume you are wanting decimal, so use 10)
Although the default is 10, its dangerous not to stipulate it. If a zero left-padded number gets passed then praseInt assumes Octal.