Is it a redundancy to have a single button in the form and then assign type='Ubmit' to it?

Asked

Viewed 35 times

0

In the Phpstorm is said in a certain button, through a tooltip:

Redundant default attribute value assingment

When exactly this line is made:

<button type="submit" id="btnSubmit" class="width-65 pull-right btn btn-sm btn-success">
    <span class="bigger-110">Cadastrar</span>
        <i class="ace-icon fa fa-arrow-right icon-on-right"></i>
</button>

It really is a redundancy to have a single button on the form and then assign type='submit' just for him? I can eliminate this line without problems?

  • It does not cause problems, the click in a button within a form will make a submit, then define how submit is redundant

1 answer

0

Yes, the default attribute value type tag button is the submit as referenced W3C official.

So in theory you can omit it smoothly. But maintaining will also not generate problems.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.