Question

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

Was it helpful?

Solution

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

Should do it :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top