Making a weight converter
-
Hello! I’m trying to make a converter that will update the calculated fields of several weight values at once. It would ideally work onkeyup.
The first form on this page is the kind of thing I mean: https://www.w3schools.com/howto/howto_js_weight_converter.asp
But unfortunately W3 only explain how to do the javascript for one at a time!
This is the function I came up with, but it doesn’t seem to work at all:
(function(){
if (fieldname4>0) return fieldname4/0.45359237;
if (fieldname6>0) return fieldname6/14;
return fieldname5;
})()I think the main problem is it gets confused trying to do both/all at once.
Any ideas?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Making a weight converter’ is closed to new replies.