Hi all,
I am trying to show a field based on another field's value and hide it it initially... like when you want students to select their schools if they have gone for education ortherwise the school field remains inactive...
I have the folowing scipt but it is not being fired on page load... I don't know where am going wrong....
<script type="text/javascript">
function OnPageLoadAdd(pageid)
{
var tName = 'dbo.Register';
var ctrleducation = Runner.controls.ControlManager.getAt(tName, pageid, 'education');
var ctrlCollage = Runner.controls.ControlManager.getAt(tName, pageid, 'Collage');
ctrleducation.on('change', function(e){
if (this.getValue() == 'yes'){
ctrlCollage.setEnabled();
ctrlCollage.addValidation("IsRequired");
}else{
ctrlCollage.setDisabled();
ctrlCollage.setValue("");
ctrlCollage.removeValidation("IsRequired");
}
});
}
</script>
Any help would be highly appreciated..