(5.3 build 7474)
Hi all,
I am having some problems with the header section of the program and with the reset button on Edit/Add pages.
- HEADER - If I put this code as my header:
<HTML {$html_attrs}><HEAD>
<link rel="icon" href="images/my_images/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="images/my_images/favicon.ico" type="image/x-icon">
</HEAD>
<BODY>
<BR>
<DIV align=center><IMG border=0 alt=Header
src="images/my_images/header.png"></DIV>
</BODY>
</HTML>
... and then switch from HTML to Design mode (to see that the files paths are ok... and they are, the header image is shown correctly)... then going back to HTML mode shows only this:
<BR>
<DIV align=center><IMG border=0 alt=Header
src="images/cmax_images/header.png"></DIV>
2) RESET BUTTON - I have this code in the OnLoad Javascript event of both Edit/Add pages:
It checks the value of one control and conditionally marks other two controls as required or otherwise clears and disable them.
var ctrlModification = Runner.getControl(pageid, 'Add/Change/Delete');
var ctrlWasPN = Runner.getControl(pageid, 'WAS_Equipment_PN');
var ctrlWasQTY = Runner.getControl(pageid, 'Quantity_WAS');
if (ctrlModification.getValue() == 'Change'){
ctrlWasPN.setEnabled();
ctrlWasPN.addValidation("IsRequired");
ctrlWasQTY.setEnabled();
ctrlWasQTY.addValidation("IsRequired");
}else{
ctrlWasPN.setDisabled();
ctrlWasPN.setValue("");
ctrlWasPN.removeValidation("IsRequired");
ctrlWasQTY.setDisabled();
ctrlWasQTY.setValue("");
ctrlWasQTY.removeValidation("IsRequired");
}
ctrlModification.on('change', function(e){
if (this.getValue() == 'Change'){
ctrlWasPN.setEnabled();
ctrlWasPN.addValidation("IsRequired");
ctrlWasQTY.setEnabled();
ctrlWasQTY.addValidation("IsRequired");
}else{
ctrlWasPN.setDisabled();
ctrlWasPN.setValue("");
ctrlWasPN.removeValidation("IsRequired");
ctrlWasQTY.setDisabled();
ctrlWasQTY.setValue("");
ctrlWasQTY.removeValidation("IsRequired");
}
});
It runs correctly when the forms are initially loaded (first part) and every time the ctrlModification control is changed to another value. It does not run after the reset button is pressed, even if I put something like this:
ctrlModification.on('reset', function(e){
if (this.getValue() == 'Change'){
ctrlWasPN.setEnabled();
ctrlWasPN.addValidation("IsRequired");
ctrlWasQTY.setEnabled();
ctrlWasQTY.addValidation("IsRequired");
}else{
ctrlWasPN.setDisabled();
ctrlWasPN.setValue("");
ctrlWasPN.removeValidation("IsRequired");
ctrlWasQTY.setDisabled();
ctrlWasQTY.setValue("");
ctrlWasQTY.removeValidation("IsRequired");
}
});
As said before, unfortunately this is not working as expected.
[color="#FF0000"]Is there a way to make it run when the reset button is pressed too? How to refer to the whole form reset and not only the control?
Thanks in advance for your help.
Cheers,
FP