I want to use HTML5 form inputs in my Yii project.
In the Yii framework, there are no functions to create type ='email'
and type='tel'
input fields like type='text'
. There is a function to create text fields called textField()
in the Yii Framework, but once I searched, they have only the tag()
function to create "email" and "tel" input tags. I used that function in my code and created input fields, but the problem is that I cannot validate my form fields as it does so well with textField()
functions.
This is my code:
echo CHtml::tag($tagName,
array('id'=>'Contactus_email',
'name'=>'Contactus['.$value['fieldname'].']',
'class'=>'input_height',
'type'=>'email',
'placeholder'=>$value['placeholder']
), false, true);