form.php
public function setField(SelectorInterface $selector, $value, $position=false)
    {
        $success   = false;
        $_position = 0;
        for ($i = 0, $count = count($this->widgets); $i < $count; $i++) {
            if ($selector->isMatch($this->widgets[$i])) {
                $_position++;
                if ($position === false or $_position === (int) $position) {
                    if ($this->widgets[$i]->setValue($value)) {
                        $success = true;
                    }
                }
            }
        }

        return $success;
    }
public function setField(SelectorInterface $selector, $value, $position=false)
    {
        $success   = false;
        $_position = 0;
        for ($i = 0, $count = count($this->widgets); $i < $count; $i++) {
            if ($selector->isMatch($this->widgets[$i])) {
                $_position++;
                if ($position === false or $_position === (int) $position) {
                    if ($this->widgets[$i]->setValue($value)) {
                        $success = true;
                    }
                }
            }
        }

        return $success;
    }
Sets a widget value within the form.

@param $selector   Criteria to apply.
@param string $value Value to input into the widget.

@return bool                   True if value is legal, false otherwise.
If the field is not present, nothing will be set.