473,395 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to use multiple Validation on a text box that is Dynamic

syedshaffee
Guyz,
I have a problem here is the code doesn't' work Please help
Expand|Select|Wrap|Line Numbers
  1. function validateFormMultiple(theForm)
  2. {
  3. for (var i=0; theForm.same.checked; i++){
  4. if (theForm.same[i].checked ){
  5. if (theForm.Date[i].value == "") {
  6.             alert("Please Enter the Date.");
  7.             theForm.Date[i].focus();
  8.             return false;
  9.         }
  10.  
  11.         if (theForm.Comments[i].value == "") {
  12.             alert("Please select the Inspection Date.");
  13.             theForm.Comments[i].focus();
  14.             return false;
  15.         }
  16.  
  17.         theForm.EditType.value="Add";
  18.         return true;
  19.         }
  20.         else{
  21.         alert("Please Select Asset");
  22.      }
  23.    }
  24.  }
is something wrong please help
Jul 5 '12 #1
4 2381
Dormilich
8,658 Expert Mod 8TB
it’s line #3. line #4 indicates that theForm.same is a collection of elements and hence theForm.same cannot have a checked property.

besides that this value is not suited in a for() loop, either the loop never starts (.checked is false) or it goes in an infinite loop (.checked is true). contrary if you check each element for its checked status, the loop will quit on the first time checked is false and no matter how many elements after that are true, they will not be evaluated.
Jul 5 '12 #2
Can U Suggest me how to Pull this Of
Jul 6 '12 #3
Dormilich
8,658 Expert Mod 8TB
that depends on what you want to do.
Jul 6 '12 #4
I want to validate very line item on an HTML table that is dynamically generated having in check box and two input fields
if any of the field blank and which is checked.
Jul 9 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Avad | last post by:
I have a following screen. The login is a "user control" with validations controls in it. This side I have address book in which "name" is required field. But when I click on "add new user" the...
2
by: Shahar | last post by:
hi I have the following problem: I have two button, tow textboxes and two RequiredFieldValidator controls, like that: <form id="Form1" method="post" runat="server"> <asp:TextBox id="TextBox1"...
0
by: R.A.M. | last post by:
Hi, Do you know if using asp: validators I can have validation text in browser popup message box? Thank you very much for your help. /RAM/
2
by: ICBM0926 | last post by:
Hi I am studying about copy constructor in C++.I changed a part of a text book example like follows: ======================================== #include <iostream> #include <cstring> using...
6
by: xiaobaiyang | last post by:
which text book is just for the c++ beginers? thks
2
by: englishman69 | last post by:
Hello, I have been banging my head against this one for a while... Searches online have revealed many different proposals for correcting my issue but none that I can follow! My basic situation...
0
by: agiler | last post by:
help,a regular text file how to sql 2000 table code ? i have a text file as follow, line with ¡°|¡±and {LF}, 8|-000000186075919.|+000000000387820.|2008-03-31|20010423|...
0
by: tutorialwebs | last post by:
CGI Programming text book http://www.365x24live.com/CGI%20Programming%20Unleashed/index.htm Java Script Text Book http://www.365x24live.com/JavaScript/INDEX.HTM Applied Cryptography...
0
by: tutorialwebs | last post by:
Vb Script Text Book http://www.365x24live.com/vbscript/index.html Java Script Text Book http://www.365x24live.com/JavaScript/INDEX.HTM Applied Cryptography...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.