Andy_con
ClioSport Club Member
clio 182
In document ready you'd do something like:
$('#m1-sum-arg3Field').text("1.50")
whatever fields are appropriate.
where abouts in the code would i put that, i just put it here and nothing happened
(i didnt bother copying all the code)
/**
* Called when document is loaded.
*/
phoneui.documentReadyHandler = function() {
}
$('#m1-sum-arg3Field').text("1.50")
}
function updateTotal() {
//read arg1-arg4 input values
// inspect the html file to get the field IDs
var arg1 = parseFloat($('#m1-sum-arg1Field').val());
var arg2 = parseFloat($('#m1-sum-arg2Field').val());
var arg3 = parseFloat($('#m1-sum-arg3Field').val());
var arg4 = parseFloat($('#m1-sum-arg4Field').val());
//convert all non-numeric (NaN) inputs to 0
arg1 = isNaN(arg1) ? 0 : arg1;
arg2 = isNaN(arg2) ? 0 : arg2;
arg3 = isNaN(arg3) ? 0 : arg3;
arg4 = isNaN(arg4) ? 0 : arg4;
//compute sum of args
sum = (arg1*arg2)+((arg1*arg1)/(2*(arg3+(0.1*arg4))));