I have a simple Javascript function, but its not working inside a form. It looks like this:
echo "<tr><td><form name='formfolder' method='POST' action='?module=pindah_dok_index' >";
echo "<input type=hidden name='id_debt' value='$_GET[id_debt]' />";
echo "move docs</td><td>";
echo "<input type='text' name='index1_dok' id='xcvbn' onkeyup='xcvbn()' style='width:80px;' required />";
But when I place my input #xcvbn
before / outside the form, it works perfectly.
My Javascript function is simple like this:
function xcvbn(){
var xx=document.getElementById("xcvbn");
var x = xx.value;
var str = x.replace(/[^0-9a-zA-Z\-_.]/g, '');
var str = str.toUpperCase();
xx.value = str;
}