This topic is locked

Header problem & Reset button code

12/21/2011 8:16:21 AM
PHPRunner General questions
F
FlowerPower author

(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.

  1. 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

Sergey Kornilov admin 12/21/2011

In regards to header file - you should not add BODY and HTML tags there. These tags exist already in the main page template.
In regards to Reset button behavior I recommend to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

F
FlowerPower author 12/21/2011

Hi,
thank you for the quick reply... but then how to put a favicon reference in the project?

Sergey Kornilov admin 12/21/2011

You can modify lheader.htm template file. For example for Amsterdam layout modify C:\Program Files\PHPRunner5.3\templates\layouts\Amsterdam\lheader.htm file.