Afficher un message
Vieux 08/04/2008, 12h43   #3
Harlan Messinger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need unique ids using include file

DanWeaver wrote:
> I have several sets of controls that are repeated. I am trying to use
> include files to to the job so as to have my 'tablet' html in one
> place.
>
> <div id="0" class="tablet">
> <!-- #include virtual ="tablet.inc" -->
> </div>


You can't have id="0". An id can't start with a digit. Try id="div0".

> <div id="1" class="tablet">
> <!-- #include virtual ="tablet.inc" -->
> </div>
>
> <div id="2" class="tablet">
> <!-- #include virtual ="tablet.inc" -->
> </div>


If you were using ASP, it would be

<% dim n
n = 0
%>
<div id="div<%=n%>" class="tablet">
<!-- #include virtual ="tablet.inc" -->
</div>
<% n = n + 1 %>

etc.

> I would like the id of each control in the repeated include file to be
> unique- it doesnt matter what it is called but it must be unique to
> the page.
>
> tablet.inc has elements such as:
>
> <input id="blah" name="blahname"


<input id="blah<%=n%>" name="blahname"

> onkeyup="somejavascriptfunction(this)" />

  Réponse avec citation
 
Page generated in 0,04828 seconds with 9 queries