0

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?

1 Answer 1

1

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'
    )
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.