Welcome Guest, Not a member yet? Register   Sign In
getPost() not working as expected
#5

(10-29-2020, 09:38 AM)paulbalandan Wrote: If the field is optional, then you can add the permit_empty rule.
Thanks Paul,

I really appreciate you comments, but how do i validate if I can't even get hold of the value, my issue isn't validation it is with the $this->request->getPost() statement.

Are we saying that when a form value is empty, ie
PHP Code:
<input type="text" name="first_name" value="" /> 

the statement

PHP Code:
if($this->request->getPost('first_name')) { .. 

is FALSE ???

Surely the value is "empty"!

And, if I then validate
PHP Code:
$this->request->getPost('first_name'

my rules should validate against an empty value (like you suggested)?

Or, am I missing something???

Sorry to be a pain :-)
Reply


Messages In This Thread
getPost() not working as expected - by 68thorby68 - 10-29-2020, 03:01 AM
RE: getPost() not working as expected - by 68thorby68 - 10-29-2020, 12:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB