In my razor view, I'm using a Html.BeginForm
. In it I have two elements where when I set clic, should submit the form but I need to add an additional string parameter.
@using (Html.BeginForm("Index", "Quiz", FormMethod.Post, new { id = "form" }))
{
...
}
[HttpPost]
public ActionResult Index(string parameter, QuizCompletedViewModel q) //FormCollection f)
{
...
if (button.Equals("d"))
{
...
return RedirectToAction("ShowResults", new { testId = Quiz.QuizId, answeredTest = answeredId });
}
else
{
...
return RedirectToAction("Index", "Dashboard");
}
}
So, in my jquery function I utilize $("#element").submit()
and the parameter parameter
always is null (and that's normal). How can I add additional data for parameter
using JQUERY?
NOTE: I'm not using AJAX.