Hello,
this is on edit page on javascript onload event.
I have a field on my form 'lock_avion' is a checkbox if "Lock" is checked after saving the data i need some fields to be disable and 'lock_avion' field to be hidden next time they want to edit the form. and only if the user logged in is 'Joan' the control 'lock_avion' will show. I already add the php code snippet to the page to get the username. but im getting this error "Uncaught TypeError: Object #<Object> has no method 'getControl'" and i cant solve this please help. also when i upload this to the server all my date fields on the form go blank and disabled...
echo "<script>
window.username = '" . $_SESSION["UserID"]. "';
window.group = '" . $_SESSION["GroupID"]. "';
</script>";
var ctrlLock = Runner.getControl(pageid, 'lock_avion');
var ctrlRut5 = Runner.getControl(pageid, 'RutaPasajero5');
var ctrlVal = ctrlLock.getValue();
if (ctrlVal == 'Lock' && username != 'Joan')
{
ctrlRut5.setDisabled();
ctrlLock.hide();
}