title: how to submit a <form action=" " > using sweet alert. because it must be use "action". I usually using href
body: <p>I get trouble when using sweet alert on my submit a form, I usually use a href but it must use form action <br>
  I don't know :(</p>
  
  <pre><code>&lt;form class="form-horizontal text-right m-b-1" action="&lt;?php echo base_url('pegawai/editfoto') ?&gt;" method="POST"&gt;
  
                          &lt;div class="col-9 "&gt;
                              &lt;div class="fileupload fileupload-new" data-provides="fileupload"&gt;
                                  &lt;div class="fileupload-new thumbnail " style="width: 200px; height: 150px;"&gt;
                                      &lt;img src="&lt;?php echo base_url('uploads/'.$data[0]-&gt;foto)?&gt;" alt="image" class="img-fluid" /&gt;
                                  &lt;/div&gt;
                                  &lt;div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"&gt;&lt;/div&gt;
                                  &lt;div&gt;
                                      &lt;button type="button" class="btn btn-custom btn-file"&gt;
                                          &lt;span class="fileupload-new"&gt;&lt;i class="fa fa-paper-clip"&gt;&lt;/i&gt; Select image&lt;/span&gt;
                                          &lt;span class="fileupload-exists"&gt;&lt;i class="fa fa-undo"&gt;&lt;/i&gt; Change&lt;/span&gt;
                                          &lt;input type="file" name="foto" class="btn-light" /&gt;
                                      &lt;/button&gt;
                                      &lt;a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload"&gt;&lt;i class="fa fa-trash"&gt;&lt;/i&gt; Remove&lt;/a&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                            &lt;/div&gt;
                            &lt;br&gt;
                            &lt;div class="form-group account-btn text-center m-t-10"&gt;
                                &lt;div class="col-12"&gt;
                                    &lt;button type="button" class="btn w-lg btn-rounded btn-primary waves-effect waves-light" id="sa-editfoto" &gt;Save&lt;/button&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;
                        &lt;/form&gt;
  </code></pre>
  
  <p>and the code of sweet alert</p>
  
  <pre><code>$('#sa-editfoto').click(function () {
            var link= $(this).attr("link-href")
            $('#sa-editfoto').attr("src", link);
              swal({
                  title: 'Apakah Anda Yakin?',
                  text: "Foto Profile akan diubah",
                  type: 'question',
                  showCancelButton: true,
                  confirmButtonClass: 'btn btn-confirm mt-2',
                  cancelButtonClass: 'btn btn-cancel ml-2 mt-2',
                  confirmButtonText: 'Yes'
              }).then(function () {
                window.location.href = link;
              })
          });
  </code></pre>
  
  <p>help me if you know the answer, thank you</p>