onchange="check_extension(one)"Here
oneis the Node with the id "one",oneis not the string"one"document.getElementById("$field_id");Even if
$field_idis the id"one","$field_id"is a different string
SogetElementById("$field_id")will give you the node with id"$field_id", not the node with id"one".
Fixes
onchange="check_extension('one')"
and
document.getElementById($field_id)
Also I discourage naming string variables with a leading $
Volune
- 4.3k
- 24
- 23