JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
</head>
<body>
<form action="" method="post" id="searcher" name="InsertForm" enctype="multipart/form-data">
<input onkeypress="kW2PS();" onblur="kW2PS();" onkeyup="kW2PS();" style="width: 77px" maxlength="3" size="2" type="text" name="powerKW">kW
<input onkeypress="PS2kW();" onblur="PS2kW();" onkeyup="PS2kW();" type="text" name="powerPS" size="2" value="" style="width: 77px">PS
</form>
</body>
</html>
JavaScript
function kW2PS() {
out = document.InsertForm.powerKW.value;
out = Math.round(out * 1.359622);
document.InsertForm.powerPS.value = out;
}
function PS2kW() {
out = document.InsertForm.powerPS.value;
out = Math.round(out / 1.359622);
document.InsertForm.powerKW.value = out;
}