Welcome Guest, Not a member yet? Register   Sign In
Add the correct HTML attributes to the form helper
#1

Does anyone have time for a little change?
It would be correct for the form helper to set the attributes "required",  "disabled",  "autofocus", "readonly"
Basically it's boolean values output as 

Code:
<input type="text" required disabled autofocus readonly>

I think it's worth adding this feature to parse_form_attributes() function.
What for? It is not possible to easily set these options in form_input(), form_textarea(), etc.
Empty values are inserted. For HTML 5 this is wrong

PHP Code:
form_input([
  'name' => 'datebirth',
  'value' => set_value('datebirth'$dateBirth),
  'class' => 'form-control',
  'type' => 'date',
  'disabled' => empty($dateBirth) ? false true,
  'required' => false,
  'readonly' => false
])
// <input type="date" name="datebirth" value="" class="form-control" disabled="" required="" readonly=""> 
Reply
#2

I would gladly review a Pull Request from you Smile
Reply
#3

I had no experience in open source support  Rolleyes

If no one does it, I'll try it later
Reply




Theme © iAndrew 2016 - Forum software by © MyBB