I'm still quite new to jQuery and I'm trying to set up the jQuery.Validate plugin so that it's all Display the error message under the submit button instead of everywhere in the document. I have one table of options with one check box in each row, any check box selected error message is not displayed on the first row of the table, which will cause confusion for users.
Is there a way to define a tag "static path", so that it can always be found? Or what am I doing wrong?
This is what I'm trying to do:
$ ("# form1"). Validate ({Rule: {"CbSelect []": {Required: true, Minimalfai: 1}}, Message: {"CBCActed []": {REQUIRED: "Please select at least one employee.", Minimality : "Please select at least one employee."}}, ErrorContainer: "#errorList", error label Container: "#errorList ul", wrapper: "li", debug: true}); Here's my code only with the relevant parts:
using New {class = "required"})% & gt; Html.DropDownList ("dropdown action", new selection list (model actions, "value", "text"), "(select)" & Lt; Input type = "submit" value = "submit" /> & Lt; Div class = "errorList" & gt; & Lt; Ul & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Fieldset & gt; & Lt; Table ID = "Employee" & gt; & Lt; Tr id = "rowHeader" & gt; & Lt; Th style = "text-align: center;" & Gt; & Lt; Input type = "checkbox" class = "checkout" /> & Lt; / Th & gt; ... & lt; / Tr & gt; & Lt;% foreach (model in model times) {%> & Lt; Tr id = "& lt;% = Html.Encode (item.Id)%> & gt; & Gt; & Lt; Td style = "text-align: center;" & Gt; & Lt; Input type = "checkbox" name = "CB-selection []" class = "selected" value = "& lt;% = Html.Encode (item.Id)%> / & Gt; & Lt; / TD & gt; ... & lt; / Tr & gt; & Lt;%}% & gt; & Lt; / Table & gt; & Lt; / Fieldset & gt; & Lt;%}% & gt;
Oh ... I understood it. I have & lt; Div class = "errorList" & gt; I use the "# Error List" when it should be . "Error list"
Thanks to all those who saw it.
Comments
Post a Comment