How can you solve getElementById Returns Null in Apex Form on Visualforce Page error effectively?
I'm attempting to make a form on a Visualforce page that will, when a button is clicked, grab the contents of a SelectList and 2 InputFields and then perform some actions with those values via a function in Javascript.
However, the contents of these fields are always returned as null by document.getElementById(). I have tried using both the '{!$Component.path.to.id}' and the 'path.to.id' approaches with no luck
For privacy reasons I've obfuscated/shortened some of the code below, but I hope it will suffice:
Visualforce Page:
Any insight is greatly appreciated.
You do not include the page's ID to solve getelementbyid returns null:
var override_prod = document.getElementById('{!$Component.block1.form1.overr_prod}');