This topic is locked
[SOLVED]

 on page load phprunner 5.3

1/17/2011 7:29:34 AM
PHPRunner General questions
ffrinai author

Hi,

i have a problem with on page load java from phprunner 5.2 to 5.3 version.

My code is :
var ctrlTipo = document.getElementById('value_tipo_1');

var ctrlSetipo1 = document.getElementById('value_setipo1_1');

var ctrlSetipo2 = document.getElementById('value_setipo2_1');
ctrlTipo.onchange = function()

{
if (this.value == '1'){

ctrlSetipo1.style.visibility='';

ctrlSetipo2.style.visibility='hidden';

ctrlSetipo2.value='';

document.forms.editform1.value_tipo_1.style.backgroundColor="yellow";

document.forms.editform1.value_setipo1_1.style.backgroundColor="yellow";

}

else{

ctrlSetipo1.style.visibility='hidden';

ctrlSetipo1.value='';

document.forms.editform1.value_tipo_1.style.backgroundColor="orange";

document.forms.editform1.value_setipo2_1.style.backgroundColor="orange";

ctrlSetipo2.style.visibility='';

}

};
//Esegue il controllo sul valore del campo una volta caricata la pagina

ctrlTipo.onchange();
the control ctrlSetipo2 disappear when i select first value 1 for value_tipo_1 (drop down) and then i select value 2 for value_tipo_1

The colors desappeared
with 5.2 it works fine.

Thanks

romaldus 1/17/2011



Hi,

i have a problem with on page load java from phprunner 5.2 to 5.3 version.

My code is :
var ctrlTipo = document.getElementById('value_tipo_1');

var ctrlSetipo1 = document.getElementById('value_setipo1_1');

var ctrlSetipo2 = document.getElementById('value_setipo2_1');
ctrlTipo.onchange = function()

{
if (this.value == '1'){

ctrlSetipo1.style.visibility='';

ctrlSetipo2.style.visibility='hidden';

ctrlSetipo2.value='';

document.forms.editform1.value_tipo_1.style.backgroundColor="yellow";

document.forms.editform1.value_setipo1_1.style.backgroundColor="yellow";

}

else{

ctrlSetipo1.style.visibility='hidden';

ctrlSetipo1.value='';

document.forms.editform1.value_tipo_1.style.backgroundColor="orange";

document.forms.editform1.value_setipo2_1.style.backgroundColor="orange";

ctrlSetipo2.style.visibility='';

}

};
//Esegue il controllo sul valore del campo una volta caricata la pagina

ctrlTipo.onchange();
the control ctrlSetipo2 disappear when i select first value 1 for value_tipo_1 (drop down) and then i select value 2 for value_tipo_1

The colors desappeared
with 5.2 it works fine.

Thanks


var ctrlTipo = Runner.getControl (pageid, 'value_tipo_1');

var ctrlSetipo1 = Runner.getControl (pageid, 'value_setipo1_1');

var ctrlSetipo2 = Runner.getControl (pageid, 'value_setipo2_1');
ctrlTipo.on('change', function(e)
{
if (this.getValue == '1'){

ctrlSetipo1.style.visibility='';

ctrlSetipo2.style.visibility='hidden';

ctrlSetipo2.value='';

document.forms.editform1.value_tipo_1.style.backgroundColor="yellow";

document.forms.editform1.value_setipo1_1.style.backgroundColor="yellow";

}

else{

ctrlSetipo1.style.visibility='hidden';

ctrlSetipo1.value='';

document.forms.editform1.value_tipo_1.style.backgroundColor="orange";

document.forms.editform1.value_setipo2_1.style.backgroundColor="orange";

ctrlSetipo2.style.visibility='';

}

};
E
ericholiveira 1/17/2011

Hi Fabiousf
test



var ctrlTipo = Runner.getControl(pageid, 'value_tipo_1');

var ctrlSetipo1 = Runner.getControl(pageid, 'value_setipo1_1');

var ctrlSetipo2 = Runner.getControl(pageid, 'value_setipo2_1');
ctrlTipo.on('change', function(e){
if (this.value == '1'){

ctrlSetipo1.show();

ctrlSetipo2.hide();

ctrlSetipo2.setValue('');

ctrlTipo.getDispElem().css("background-color", "yellow");

ctrlSetipo1.getDispElem().css("background-color", "yellow");

}

else{

ctrlSetipo1.style.visibility='hidden';

ctrlSetipo1.setValue('');

ctrlTipo.getDispElem().css("background-color", "orange");

ctrlSetipo2.getDispElem().css("background-color", "orange");



}

});
ffrinai author 1/18/2011



Hi Fabiousf
test



var ctrlTipo = Runner.getControl(pageid, 'value_tipo_1');

var ctrlSetipo1 = Runner.getControl(pageid, 'value_setipo1_1');

var ctrlSetipo2 = Runner.getControl(pageid, 'value_setipo2_1');
ctrlTipo.on('change', function(e){
if (this.value == '1'){

ctrlSetipo1.show();

ctrlSetipo2.hide();

ctrlSetipo2.setValue('');

ctrlTipo.getDispElem().css("background-color", "yellow");

ctrlSetipo1.getDispElem().css("background-color", "yellow");

}

else{

ctrlSetipo1.style.visibility='hidden';

ctrlSetipo1.setValue('');

ctrlTipo.getDispElem().css("background-color", "orange");

ctrlSetipo2.getDispElem().css("background-color", "orange");
}

});




It doesn't work.

no colors and no hidden fields.

May I send you a copy of project ? (it is a little test project (4696 Kb zipped) with mysql data backup)

romaldus 1/18/2011



......

It doesn't work.

no colors and no hidden fields.

May I send you a copy of project ? (it is a little test project (4696 Kb zipped) with mysql data backup)


your code :

if (this.value == '1'){


try this :

if (this.getValue == '1'){
ffrinai author 1/18/2011



your code :

if (this.value == '1'){


try this :

if (this.getValue == '1'){



nothing is changed, I'm sorry!

Sergey Kornilov admin 1/18/2011

Fabiusf,
if you need help 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.

ffrinai author 1/27/2011

Solved:
var ctrlTipo = Runner.getControl(pageid, 'tipo');

var ctrlSetipo1 = Runner.getControl(pageid, 'setipo1');

var ctrlSetipo2 = Runner.getControl(pageid, 'setipo2');
ctrlTipo.on('change', function(e){

if (this.getValue() == '1'){
ctrlSetipo1.show();

ctrlSetipo2.hide();

ctrlSetipo2.setValue('');

ctrlTipo.addStyle('background-color : yellow ;');

ctrlSetipo1.addStyle('background-color : yellow ;');

}

else{

ctrlSetipo1.hide();

ctrlSetipo1.setValue('');

ctrlSetipo2.show();

ctrlTipo.addStyle('background-color : orange ;');

ctrlSetipo2.addStyle('background-color : orange ;');

}

});
Thanks to support help too