Welcome Guest, Not a member yet? Register   Sign In
Forms displaying error if no result is found.
#3

you could do it in two passes -- assemble the form element
$data['bfname'] = array(
'name' => 'bfname',
'id' => 'bfname',
'class' => 'form-control',
'type' => 'text',
);

and then depending on the condition in a separate method add the relevant value to the array
$data['bfname']['value'] = $some value

so then you can call different methods to add the field value depending on if you are getting something back from the database, etc
which is not quite as cool as what you are doing - you are doing it in one pass - but i like having it be very obvious whether the value is coming from the database or not.
Reply


Messages In This Thread
RE: Forms displaying error if no result is found. - by cartalot - 04-07-2016, 01:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB