⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Getting 'field is required' message when field has been filled in



vardas

vardas
  • profile picture
  • Member

Posted 13 July 2015 - 15:55 PM

I am getting the warning message '...field is required' for SET fields even when an item has been selected for the SET.

The validation of all of the other field types works fine it is just SET fields that do not get validated properly.

 

Is there a way around this?


Paul Savostin

Paul Savostin
  • profile picture
  • Member

Posted 13 July 2015 - 20:23 PM

Hi! Try to use  more advanced question with example screenshots if you need any help.


Json Sean

Json Sean
  • profile picture
  • Member

Posted 14 September 2017 - 08:49 AM

You may solve  it by /topic/3715-multiselect-validation-fails-on-v157/#entry15517

 

Modify file of 'system/libraries/Form_validation.php':

 

in the function "public function run($group '')",before _execute action add codes like this:

 

...

 

if(in_array('required',$row['rules']) and is_array($row['postdata'])){
$row['postdata'] = json_encode($row['postdata'],JSON_UNESCAPED_UNICODE);
}

 

...
$this->_execute($row$row['rules'], $row['postdata']);