How to use anchor tag to send when using Html.BeginForm? The method has BeginFormno way to specify the name of the form so that I can do it
Html.BeginForm
BeginForm
<a href="JAVASCRIPT:Form1.submit()">Next</a>
This does not work because it does not exist Form1.
Form1
If you are using jQuery, use
<a href="javascript:$('form').submit();">Submit</a>
So you add the attribute "name" using the htmlAttributes object
<% using (Html.BeginForm("Action", "Controller", FormMethod.Post, new { name = "MyFormName" }))
, :
<a href="javascript:document.getElementsByTagName('form').item(0).submit()">Next</a>
jQuery onclick .closest('form'):
onclick
.closest('form')
<a href="#" onclick="$(this).closest('form').submit(); return false;">My link</a>
Source: https://habr.com/ru/post/1706291/More articles:Accessing variables from other namespaces - variablesUpdatePanels - Элементы управления снаружи повторно отображаются? - c#Testing a specific third-party class with JMock - javaThe fastest way to split a 32-bit number into bytes in C ++ - c ++Is there a way besides Mono to run Microsoft.NET on Mac or Linux? - linuxhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1706292/how-do-you-simply-add-new-custom-rewrites-to-the-htaccess-of-a-wordpress-without-fail&usg=ALkJrhjt6DIg7IsOGQt9MU7rbUCmCqGp6wWordPress + mod_rewrite - phpregex to match any UTF character excluding punctuation - phpVB.NET: What is the best way to get the value from the second form? - vb.netWhere is Prolog used for traffic management systems? - prologAll Articles