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
Post a Comment