Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Do not preventDefault on form submit if action="" #5962

Closed
@tomzx

Description

@tomzx

Hi,

The current code/documentation (http://docs.angularjs.org/api/ng.directive:form) says the following about a form default action:

Submitting a form and preventing the default action
[...]
For this reason, Angular prevents the default action (form submission to the server) unless the <form> element has an action attribute specified.

Yet, if you specify <form action="">...</form>, angularjs consider that no action attribute is specified, which is not true.

The test condition in src/ng/directive/form.js is not strict enough (in the form directive)

if (!attr.action) {

I'm no JS expert, but I think a stricter comparison would be more appropriate (such as the following)

if (typeof attr.action === 'undefined') {

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions