User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 332,637 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,238 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 544 | Replies: 2
Reply
Join Date: Dec 2007
Posts: 24
Reputation: abhi287 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
abhi287 abhi287 is offline Offline
Newbie Poster

form validation

  #1  
Mar 7th, 2008
Hi all

On my jsp page i m having two tables..
first table have 14 rows which takes input type=text.

and

my second table is having 9 rows which also takes 9 inputs.

Thus total 23 inputs on a form..
Now when the user click submit, i want to check if total of 20 inputs are fill or less than that..
Means user can input max 20 inputs from both the tables..

plz reply for such validation..

Thanks..
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Location: Bangalore, India
Posts: 327
Reputation: DangerDev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 31
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Whiz

Re: form validation

  #2  
Mar 7th, 2008
Hi
try this:
-let an input element is haveing name='name' and id='id'
-get the element by
var elem=document.form1.name
if form1 is name of form
or
var elem=document.getElementById('id');
-after that check elem.value.lenght is 0 or what
-on the basis of above you can check other input element also
-use good logic to do this for all input element

have a nice day !
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
Reply With Quote  
Join Date: Dec 2007
Posts: 24
Reputation: abhi287 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
abhi287 abhi287 is offline Offline
Newbie Poster

Re: form validation

  #3  
Mar 8th, 2008
i know the script and hoe to access the input field..
but i want the count for how much fields are entered and then to check if it is less than 20..

so how i'll increase the count if the field is filled ..
or somethig another logic..

plz reply..
thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 2:30 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC