0

I have a click event of save button and inside that event I fired submit button. Now whenever I click save button it refresh the page. I don't want to refresh. Please anybody help to solve this problem.

$(document.body).on('click','#saveid',function(){
   $('#idsubmit').click();
});

I have a form and submit button inside it. There is a save button outside the form.

<form id="idx"  action="@Url.Action("Admission","Admission")" method="post" enctype="multipart/form-data">
             <input style="width:150px"  type="file" name="filea" id="idFile" />
             <input type="submit" id="idok" value="OK" />
    </form>

<button type="button" id="saveid">Save</button>
Biffen
  • 6,249
  • 6
  • 28
  • 36
dirghayu
  • 53
  • 1
  • 6

1 Answers1

0

add

      onsubmit ="return false"

in form tag

Banik
  • 911
  • 6
  • 10
  • then keep the action tag blank and use $(document.body).on('click','#saveid',function(){ window.location = ' @Url.Action("Admission","Admission")'; }); this link might help you http://stackoverflow.com/questions/16052704/how-to-pass-dynamic-value-in-url-action?answertab=votes#tab-top – Banik Mar 29 '15 at 10:38