This topic is locked

Validation using .addValidation

12/3/2012 7:26:21 AM
PHPRunner General questions
M
markynewport author

Hello,

I have used the below code to validate a field based on input from another field,

Validation functions fine,

One small snag,

I don't get the Red Asterisk after the field when the validation is applied.
Required Field appears only when the user is saving the record.

Any help greatly appreciated...

Mark.
var ctrlfield= Runner.getControl(pageid, 'field');

var ctrlanotherfiled= Runner.getControl(pageid, 'anotherfiled');

//-----ON CHANGE CODE
ctrlanotherfiled.on('change', function(e){

if (this.getValue() != 'condition')

{

ctrlfield.addValidation("IsRequired");

}else{

ctrlfield.removeValidation("IsRequired");}});

Sergey Kornilov admin 12/3/2012

This behaviour is by design. The red asterisk won't appear next to fields that were made required in run time.