I have a form in the CodeIgniter framework, and I want to use the HTML "required" attribute. How can I do 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%" />
'required' => 'required'?