tags:

views:

800

answers:

3

Hi,

The subject says it all.

The BeginForm does not have a way of giving the form name so that I can do this

<A HREF="JAVASCRIPT:Form1.submit()">Next</A>

This fails because no Form1????

Malcolm

A: 

If you've only got one form on the page the following code should work:

<a href="javascript:document.getElementByTagName('form').item(0).submit()">Next</a>
emaster70
+3  A: 

This is how you add a "name" attribute using the htmlAttributes object

<% using (Html.BeginForm("Action", "Controller", FormMethod.Post, new { name = "MyFormName" }))
Mark
+2  A: 

If you're using jQuery use

<a href="javascript:$('form').submit();">Submit</a>
Paul Allies