Issue
I am using CakePHP 3. I would like to generate my own style input tag. My code is:
<?php
echo $this->Form->input(
'rpassword', array(
'class' => 'form-control placeholder-no-fix',
'type' => 'password',
'autocomplete' => 'off',
'placeholder' => 'Re-type Your New Password'
)
);
?>
It generates HTML as follows:
<input name="data[Reseller][rpassword]" class="form-control placeholder-no-fix " autocomplete="off" placeholder="Re-type Your New Password" type="password" id="ResellerRpassword" >
But I want to set name attribute as 'rpassword' only. My expected HTML is:
<input name="rpassword" class="form-control placeholder-no-fix " autocomplete="off" placeholder="Re-type Your New Password" type="password" id="ResellerRpassword" >
Is there any way to do this?
Solution
You can set the name
attribute in the input
parameters like 'name' => 'rpassword'
:-
echo $this->Form->input(
'rpassword', array(
'class' => 'form-control placeholder-no-fix',
'type' => 'password',
'name' => 'rpassword',
'autocomplete' => 'off',
'placeholder' => 'Re-type Your New Password'
)
);
Answered By - drmonkeyninja
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.