ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Java Script Help



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))));
 
  AB182, Audi A5 3.0
can you not write iPhone apps in java? Java is a much nicer language to learn/understand than JavaScript... Or even Objective C?
 

Andy_con

ClioSport Club Member
  clio 182
things are looking good just one more bit of java script to get sorted and the app is done :)

resultpage_zpsaa0ff38c.png
 

Andy_con

ClioSport Club Member
  clio 182
ok so my next big thing to do

this is the first page -

first_zpsb993f576.png


i can probably faff around with the coding i have to make this page. but i need this page to turn mph/kph into metres per second and put that result automatically into the speed column on the second page. how do you get the result to post in a completely seperate file??

second page -

resultpage_zpsaa0ff38c.png
 

Andy_con

ClioSport Club Member
  clio 182
Ahhh i don't want to start all over again.

you make it sound so simple...

i do have a copy of dreamwaeaver and a rough idea how to use it
 


Top