codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  How to know the Control Type in javascript  ransom at 06:42 on Wednesday, July 27, 2005
 

Hi,
I have to validate the controls on the form based on a logic.What i am doing is that based on that logic i create an array of control Ids in my server side which has to be validated and then on the client side i am validating the controls which are in the array.

Can any body tell me how to know the control type(textbox,select...) after i am creating the control by GetElementByID method????

Best Regards


  Re: How to know the Control Type in javascript  khabilepravin at 07:50 on Friday, September 22, 2006
 

What you can do is use the type property, just like I have used in the following code...

if(frm.elements.type == "checkbox")

There might be "text" for textbox type of controls, as while creating a html input type we give something like...
<input type="text"

Tell me whether it resolves your problem or not.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: How to concatenate a string and a variable using perl?
•  Re: repaint() slow performence..
•  Re: How Can I Get The Height Of A Hidden <div>?
•  Re: Firefox/IE doctype problem.
•  Re: Plz its urgent:validation code
•  Re: Write text strings to Serial Port
•  Re: Error configuring webservice identity in reporting services 2005
•  Re: sort hash by value, numerically
•  Re: Accessing user control in master page from any content page


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010