I want to produce a radio button like this:
<input type="radio" name="quest0" value="a" required>
I am doing like this
echo form_radio("quest0","a");
But how can I add required attribute using Codeigniter form helper.
I am doing like this echo form_radio("quest0","a"); " /> I am doing like this echo form_radio("quest0","a"); " /> I am doing like this echo form_radio("quest0","a"); "/>
I want to produce a radio button like this:
<input type="radio" name="quest0" value="a" required>
I am doing like this
echo form_radio("quest0","a");
But how can I add required attribute using Codeigniter form helper.
On
One way is to write as shown by @Shaiful Islam.
Other way is to write as below:
echo form_radio("quest0","a", FALSE, "required=required");
Refer the Source Code - Form Helper - Line 459
You are passing the other parameters as EXTRA attribute
I think you can do it this way.(I did not tested it)