How do we get the value of a checkField in a post ?

Hi !

How do we get the value of a checkField in a post ?

<?php echo Phalcon\Tag::checkField(array("IsSuspect")); ?>

$this->request->getPost("IsSuspect"); ====> ALWAYS EQUAL TO FALSE

Thank

If you look at the field does the name='IsSuspect'? If you do $_POST['IsSuspect']; does it return anything?

See here: http://docs.phalconphp.com/en/latest/api/Phalcon%5Http%5Request.html#methods

The method is: public mixed getPost ([string $name], [string|array $filters], [mixed $defaultValue])

So if you arent getting anything Id make sure the original $_POST works.



17.9k

Hi

$_POST['IsSuspect'];

yes it's there but it's always false.

This is the HTML generated by the tag :

<input type="checkbox" value="N" name="IsSuspect" id="IsSuspect">