Created
February 12, 2016 09:25
-
-
Save catoidrobo/14b473ba95b95981e140 to your computer and use it in GitHub Desktop.
form1に値をいれるとform2に値が勝手に入る。今回は小数点第3位以下を切り捨てにした場合
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function space(self) { | |
document.forms['form_name'].elements['form2'].value = Math.floor(self.value * 100) / 100; | |
} | |
</script> | |
<input type="text" name="form1" value="" onchange="space(this);" /> | |
<input type="text" name="form2" value="" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment