By: Martin
Date: 2010-05-13
Time: 22:38
|
Make global template variable counter
Hi Skrol !!
How do you do, if you want to make a counter to use in <code>tabindex</code> of html elements ?
I think something like this
In php file declare a variable named: <code>$tabindex = 0</code>
In tpl file put in every html tag, for example in SELECT tag:
<code><select name="sel" id="sel" tabindex="[onshow.tabindex;ope=add:1]"></code>
So if, i have 50 form elements and change the orders of element, the tabindex properties it will be automatic.
I thinking to execute a custom function and do $tabindex++; and return the value, but i dont know if this is the best practice.
Thanks a lot !!!
Martin
|