Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS Stop blocking form

I'm relatively new to AngularJS and I am trying to sumbit a regular form. I have basic form that looks like this:

<form method="post" enctype="multipart/form-data">
input type="text" class="title span5" name="post_title" placeholder="A catchy title here..." value="" />

<input type="file" name="post_image" />

<input type="submit" class="btn btn-success" value="Create Post" />
</form>

But I noticed that AngularJS adds its own values to the form.

<form method="post" enctpye="multipart/form-data" class="ng-pristine ng-valid">

And I am ununable to submit the form. How can I disable the automatic validation that Angular JS is adding to the app?

like image 250
Devin Dixon Avatar asked Feb 04 '26 18:02

Devin Dixon


1 Answers

Quoted from the documentation:

For this reason, Angular prevents the default action (form submission to the server) unless the element has an action attribute specified.

IMHO, you should read the doc to gain some general understanding of single page application, and the reason why angular's preventing the default behavior.

like image 186
Ye Liu Avatar answered Feb 07 '26 09:02

Ye Liu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!