Created
April 9, 2021 07:12
-
-
Save vikramjeet-dev/a9f0eeb11c483647b26692afd11b7e89 to your computer and use it in GitHub Desktop.
Set another input type value same as entered previously .
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
//html input type | |
<input id="current_census" type="text" value="100" onkeyup="findPPD(this.id)"> | |
<br> | |
<input type="text" id="rn_lvn_census" value="100" onkeyup="findPPD(this.id)"> | |
<br> | |
<input type="text" id="cna_rna_census" value="100" onkeyup="findPPD(this.id)"> | |
<br> | |
<input type="text" id="data" value="100" onkeyup="findPPD(this.id)"> | |
<br> | |
<input type="text" id="census" value="100" onkeyup="findPPD(this.id)"> | |
<br> | |
<input type="text" id="data1" value="100" onkeyup="findPPD(this.id)"> | |
<br> | |
<input type="text" id="data2" value="100" onkeyup="findPPD(this.id)"> | |
//this is where the magic happens | |
<script type="text/javascript"> | |
function findPPD(id){ | |
var idVal = document.getElementById(id).value; | |
document.getElementById(id).value = (idVal>0)?parseInt(idVal, 10):0; | |
var cur_census = document.getElementById(id).value; | |
document.getElementById('rn_lvn_census').value = document.getElementById('cna_rna_census').value = document.getElementById('census').value = document.getElementById('data').value = document.getElementById('data1').value = document.getElementById('data2').value = cur_census; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello @tehoawebsite first you have to create a function i have used name findPPD but you can use any function you want and using this keyword you can populate the value where u need .