skip to Main Content

Parameters are coming null from ajax call – Jquery

I have a following method in ASP.NET MVC: public PartialViewResult SaveUpdateVariants(string TitleEn, string TitleAr, int ItemID, List<ItemVariant> data) { } I am calling it from ajax call like this $.ajax({ url: '/Inventory/SaveUpdateVariants', contentType: 'application/json; charset=utf-8', // Include ContentType data :…

VIEW QUESTION

How do I automatically submit two forms without the page refreshing? – Jquery

<form id="addToCart" action="http://my-website/cart/action.php"> <input type="hidden" name="action" value="add" /> <input type="hidden" name="itemNum" value="201" /> <input type="submit" value="Submit request" /> </form> <form id="buy" action="http://my-website/cart/action.php?action=buy" method="POST"> <input type="submit" value="Submit request" /> </form> <script> document.forms[0].submit(); document.forms[1].submit(); </script> This only submits the first form but…

VIEW QUESTION
Back To Top
Search