views:

27

answers:

1

I want to validate my form using jquery but it doesn't have an ID property as of now how to add it to the form in asp.net mvc? I am using this...

<% using (Html.BeginForm()) {%>

and my jquery validator plugin takes this,

var validator = $("#signupform").validate({

Now i want to give id as signupform... Any suggestion...

+2  A: 

This should get the id added.

<% using (Html.BeginForm(null, null, FormMethod.Post, new { id = "signupform" }))
   { } %>
Jason Rowe
@jason why action and controller are null there? Could you explain it plz?
Pandiya Chendur
I don't know where you want to post the form so I just made them null.
Jason Rowe