# Input filter and boolean value

**URL:** <https://discourse.laminas.dev/t/input-filter-and-boolean-value/3069>\
**Category:** Components & MVC\
**Tags:** laminas-form, laminas-inputfilter\
**Created:** [October 6, 2022, 5:02am UTC](https://discourse.laminas.dev/t/input-filter-and-boolean-value/3069 "2022-10-06T05:02:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MANDLA\_PILOT\_NKUNA](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/mandla_pilot_nkuna/32/1377_2.png) [@MANDLA\_PILOT\_NKUNA](https://discourse.laminas.dev/u/MANDLA_PILOT_NKUNA)\
**Post date:** [October 6, 2022, 5:02am UTC](https://discourse.laminas.dev/t/input-filter-and-boolean-value/3069/1 "2022-10-06T05:02:26Z")

</div>

I have this two fields one is Normal String the other One is Boolean, I am failing to get the boolean value from API but the string and integer I can get.

```auto
public function __construct($options = null)
{
	parent::__construct('event_billing_partner');

	$this->options = $options;
  
	$this->add(array('name' => 'PartnerName', 'type' => 'text', 'options' => array('label' => 'Name'), 'attributes' => array('required' => 'required')));

	$this->add(array('name' => 'ChargeValidation', 'type' => 'text', 'options' => array('label' => 'Charge Validation'), 'attributes' => array('required' => 'required')));
}

```

```auto
public function getInputFilter()
{
	if (!$this->inputFilter) {
		 $inputFilter->add($factory->createInput(array('name' => 'ChargeValidation', 'required' => true, 'validators' => array(), 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')))));
			$inputFilter->add($factory->createInput(array('name' => 'PartnerName', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')))));
			$this->inputFilter = $inputFilter;
	}
}

```
