Tuesday, 27 August 2013

How to call the post action of a form from outside it

How to call the post action of a form from outside it

Hi Guys i have a form that will be submitted when a button one my toolbar
is clicked. That button is outside the form. How do i achieve this, below
is what i have tried so far. Thanks
The Button
<li>
<a id="frmsub" title="" data-placement="bottom" data-title="Save"
onclick="$('#testfrm').submit()">
<span class="glyphicon glyphicon-floppy-save"></span>
</a>
</li>
My Form
<div class="vx-ds-widget">
<div class="container">
@using (Html.BeginForm("EditCreateProfile", "Manage",
FormMethod.Post, new { @id = "testfrm" }))
i have also tried this but not is working so far
$('#frmsub').click(function () {
$('#testfrm').submit();
});
{

No comments:

Post a Comment