php - CodeIgniter: input box using HTML5 required attribute -


i have form in codeigniter framework, , want use html "required" attribute. how can that?

$data = array(               'name'        => 'username',               'id'          => 'username',               'value'       => 'johndoe',               'maxlength'   => '100',               'size'        => '50',               'style'       => 'width:50%',             );  echo form_input($data);  

the result needed:

    <input type="text" name="username" id="username" value="johndoe"  required maxlength="100" size="50" style="width:50%" />  

you need add array.

$data = array(               'name'        => 'username',               'id'          => 'username',               'value'       => 'johndoe',               'maxlength'   => '100',               'size'        => '50',               'style'       => 'width:50%',               'required' => 'required'  );  echo form_input($data);  

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -