Hi there...

Im trying to validate that one integer field has a higher number than another, been trying to put some php code in there, but guess I cant figure out how to get the other fields value, I been doing some like this

if($this->value < $this->value['field_pris_min_']) {
$this->set_error();}

Well and 100 other attemps, how can I do this?

Comments

g089h515r806’s picture

the code should be in this format:

<?php
  if($this->value < $this->entity->field_pris_min[ $this->langcode][0]['value']){
    $this->set_error();
  }
?>

you could change it and correct it as your requirement.

g089h515r806’s picture

please do not include:

acoustika’s picture

Thx alot, that seems to work like a charm :-) Thumbs up

aakanksha’s picture

It works, Thanks

kenorb’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.