[RESOLVED] doubt

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

[RESOLVED] doubt

Post by vinoth »

shall we assign numbers as textbox ID ?
or any rules to assign ID to text box ?
Last edited by vinoth on Wed Sep 05, 2007 8:11 am, edited 1 time in total.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

IDs are meant to be either descriptive or as a way of differentiating between elements. There are no "rules" really, only that they are manageable.

When it comes to multiple elements of the same type, if they are related, you can always used getElementsByTagName and filter them by className and such.
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Post by vinoth »

ok fine If we use Numbers also It was worked but I don't know any rules for that or not

thats only I asked

Thanks for your Suggestion
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

vinoth wrote:ok fine If we use Numbers also It was worked but I don't know any rules for that or not
You mean using *only* numbers? I'm fairly sure it is against the CSS standards to start the ID with a number.
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Post by vinoth »

ya I assign the id as numbers alone its working

because I print 5 text box dy using for loop

Code: Select all

(for $i=0;$i<5;$i++)
{
echo "<input type='text' id='$i'>
}
Post Reply