public function getValidField($id)
    {
        $objReturn = null;

        $objFields = $this->getFields();
        foreach ($objFields as $objField) {
            if ($objField->getId() == $id) {
                $objReturn = $objField;
                break;
            }
        }

        if (is_null($objReturn)) {
            foreach ($objFields as $objField) {
                if ($objField->getName() == $id) {
                    $objReturn = $objField;
                    break;
                }
            }
        }

        return $objReturn;
    }
public function getValidField($id)
    {
        $objReturn = null;

        $objFields = $this->getFields();
        foreach ($objFields as $objField) {
            if ($objField->getId() == $id) {
                $objReturn = $objField;
                break;
            }
        }

        if (is_null($objReturn)) {
            foreach ($objFields as $objField) {
                if ($objField->getName() == $id) {
                    $objReturn = $objField;
                    break;
                }
            }
        }

        return $objReturn;
    }
public function getValidField ( $ id ) { $ objReturn = null ; $ objFields = $ this -> getFields ( ) ; foreach ( $ objFields as $ objField ) { if ( $ objField -> getId ( ) == $ id ) { $ objReturn = $ objField ; break ; } } if ( is_null ( $ objReturn ) ) { foreach ( $ objFields as $ objField ) { if ( $ objField -> getName ( ) == $ id ) { $ objReturn = $ objField ; break ; } } } return $ objReturn ; }
Get a valid field object.

This is about the most important method of ValidForm Builder. Use this to get a valid field after validation
to fetch it's validated value.

Example:
```php
$objForm = new ValidForm('example');

$objForm->addField('test', 'Test field', ValidForm::VFORM_STRING);

if ($objForm->isSubmitted() && $objForm->isValid()) {
$strTest = $objForm->getValidField("test")->getValue();
// $strTest now contains the validated value of the 'test' field which is safe for database storage etc.

$strOutput = "Test value is: " . $strTest;
} else {
$strOutput = $objForm->toHtml();
}
```
@param string $id
@return Element|null
Get a valid field object .