Search:
Namespaces
Discussions
.NET v1.1
Feedback
learning form elements'S id or name
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.languages.jscript
.
Post a new message to this list...
Savas Ates
hoe can i learn element name or id name of my inputs..
i want to read it's values. but i dont know their id or name...
Reply to this message...
Martin Honnen
Savas Ates wrote:
[Original message clipped]
Well, you can look at the source code, can't you?
Or use some collections e.g.
var form = document.forms[0];
if (form) {
var controls = form.elements;
for (var i = 0; i < controls.length; i++) {
var control = controls[i];
alert(control.type + ' with name: ' + control.name + ' with id: '
+ control.id);
}
}
You can also access all <input> elements with
var inputs = document.getElementsByTagName('input')
in Mozilla, Netscape 6/7, Opera 6/7, IE 5/5.5/6 and other modern browsers
--
Martin Honnen
http://JavaScript.FAQTs.com/
Reply to this message...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com