I want to make a farenheit to celsius converter for my weather app can anybody help?
I want to make a farenheit to celsius converter for my weather app can anybody help?
You have to add custom JS with formula to convert fahrenheit to celsius.
I'm not exactly sure of the javascript needed and I want to try and link it to a button and an input box.
I think this javascript or one of either should be fine but I need help linking it to the input box and button. Please correct it if it is wrong.
function convertToC() {
var fTempVal = parseFloat(document.getElementById('fTemp').value);
var cTempVal = (fTempVal - 32) * (5 / 9);
document.getElementById('cTemp').value = cTempVal;
return false;
}
Code: Select all
function convertToF() {
var cTempVal = parseFloat(document.getElementById('cTemp').value);
var fTempVal = (cTempVal * (9 / 5)) + 32;
console.log(fTempVal);
document.getElementById('fTemp').value = fTempVal;
return false;
}Instead predocument.getElementById('cTemp').value/pre use preAppery("componentName").val();/preOn button click add action Run JS and add body of necessary function (not entire function, just function content) to action.
I don't get the part about linking the button to the javascript can you help?
I can't see add action.
Hello -- Please take a look here: http://docs.appery.io/documentation/w...