문제

I have form in my page, I am using ajax.beginform(). Inside this form I have submit button. On submit of input button I want action of form. Following is the piece of code which may be useful for you to understand.

 @using (Ajax.BeginForm("FormContainer", "Form",  new AjaxOptions { UpdateTargetId =      "HeaderMain", HttpMethod = "Post", InsertionMode = InsertionMode.Replace }))
        {
 <input name="" type="submit" value="Request" class="propel-viewDetailsButton" />

}

On click of input button I want to call java scrip t function where I want action of a form

도움이 되었습니까?

해결책

$(".propel-viewDetailsButton").click(function() {
    var action = this.closest("form").prop("action");
}

Should do it :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top