Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 13th, 2006, 02:55 AM
Authorized User
 
Join Date: Sep 2004
Location: Delhi, Delhi, India.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get the Id of Control in ASP

Hi All,

I want to get the ID of HTML Controls from the FORM collection.

<input type=text name="name" Id="001" >

I want the ID 001 when the form is submitted.


Thanks in advance.



It is always safe to assume, not that the old way is wrong, but that there may be a better way...
*************************
Rekha
__________________
It is always safe to assume, not that the old way is wrong, but that there may be a better way...
*************************
Rekha
 
Old June 13th, 2006, 05:54 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The id is not made available to your server side code - for your request.form object will not contain any trace of it. You need to use the name attribute to identify values in request.form.

The Id is purely a client side attribute. It can be used by the client side javascript, and therefore passed back to the server via some hidden input variable (along with the value contained in the text field), but I don't think this is what you are asking to do. And probably won't be of much use, anyway.

Woody Z http://www.learntoprogramnow.com
 
Old June 14th, 2006, 07:37 AM
Authorized User
 
Join Date: Sep 2004
Location: Delhi, Delhi, India.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks woodyz,

I don't have such requirement. I just wanted to know if it is possible.


It is always safe to assume, not that the old way is wrong, but that there may be a better way...
*************************
Rekha




Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting id of a control in javascript sudhir164 Javascript How-To 2 February 23rd, 2008 05:35 AM
Passing asp control id to javascript jazzcatone ASP.NET 1.0 and 1.1 Professional 0 October 18th, 2006 01:38 PM
Master pages &server control ID - asp.net 2.0 tech user C# 2005 1 August 3rd, 2006 04:31 AM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.