This topic is locked
[SOLVED]

 Save confirm Javascript

3/20/2012 12:02:59 PM
PHPRunner General questions
S
sickacid author

Hi, I'm not wery well in Java.. I've do this code, when I set a Date in 'DataVendita' I want to get a Save Confirm, but it don't works..
var TS = Runner.getControl(pageid, 'Targa');

var DV = Runner.getControl(pageid, 'DataVendita');

TS.addCSS('highlight');

TS.addStyle('font-size: 12px;font-weight:bold; color: red;');

TS.addStyle('text-transform: uppercase;');
DV.on('change', function(e){

if (this.getValue() !=null)

{

this.on('beforeSave', function(formObj, fieldControlsArr, pageObj)

{

if (confirm('Sei sicuro di voler inserire la data di vendita?'))

return true;

else

return false;

}

)}

});

C
cgphp 3/20/2012
var TS = Runner.getControl(pageid, 'Targa');

var DV = Runner.getControl(pageid, 'DataVendita');

TS.addCSS('highlight');

TS.addStyle('font-size: 12px;font-weight:bold; color: red;');

TS.addStyle('text-transform: uppercase;');
this.on('beforeSave', function(formObj, fieldControlsArr, pageObj)

{

if (DV.getValue() != "")

{

if (confirm('Sei sicuro di voler inserire la data di vendita?'))

return true;

else

return false;

}

});
S
sickacid author 3/21/2012



Hi, I'm not wery well in Java.. I've do this code, when I set a Date in 'DataVendita' I want to get a Save Confirm, but it don't works..
var TS = Runner.getControl(pageid, 'Targa');

var DV = Runner.getControl(pageid, 'DataVendita');

TS.addCSS('highlight');

TS.addStyle('font-size: 12px;font-weight:bold; color: red;');

TS.addStyle('text-transform: uppercase;');
DV.on('change', function(e){

if (this.getValue() !=null)

{

this.on('beforeSave', function(formObj, fieldControlsArr, pageObj)

{

if (confirm('Sei sicuro di voler inserire la data di vendita?'))

return true;

else

return false;

}

)}

});


Thank's it works! But if i want to customize the message, for example with bold or color what is the right way? I've try only \n for new line and works.

C
cgphp 3/21/2012

You can't customize the style of a confirm dialog.