Click here to Skip to main content
13,549,129 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all,

how to write the script for validations using jquery, i have large form. in this form having 20 tables. All tables display:none. each table having 15-20 fields and in every table first 5 fields are required. and one button like submit

my question is how to show the required fields errors only display block tables.

how to write the jquery script..?

Every table table having the link button. in this button code behind set the table display property like style.Add("display","none") or style.Add("display","block");

when ever click on suit button then shows the validation messages.?

so, how to write the script.?
please help me.

thanks and regards
Posted 6-Feb-13 23:40pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please refer this...

JQuery Validation for Registration form containing name, email, mobile number, password[^]

In the above example I written validation with in one form. You just have to do is

     // here write validation as written in above Tip...

In the above code "table_validate" is common class name for all tables. And checking whether the table style is display block or none. If the table style is block then do validation...

Hope this will help you...
Santhosh23 7-Feb-13 7:52am
hi Vinod,

if($(this).attr("display")==="block") this syntax is correct. actually if condition having only == type format support na..?
vinodkumarnie 7-Feb-13 7:56am
Of course it should support.. But many of jquery developers use ===. So I prefer ===.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01-2016 | 2.8.180515.1 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100