Hi Josh,

This is how I did it

The tag:
<div jwcid="@Any" element="div" id="ognl:'time$'+row+'$'+column" class="scheduleClicked" onclick="ognl:'javascript:switchClicked('+row+','+column+');return false;'">

The javascript
function switchClicked(_row, _column){
if(document.getElementById('time$'+_row+'$'+_column).className == 'scheduleClicked'){ document.getElementById('time$'+_row+'$'+_column).className = 'scheduleUnclicked';
   }
   else{
document.getElementById('time$'+_row+'$'+_column).className = 'scheduleClicked';
   }
}

-erik

Josh Joy wrote:
Hi All,

I'm needing to generate unique ids to use in my
javascript function calls? The closest thing I could find on google is something called "IdAllocator" though I couldnt find any helpful
examples.

I need to do something similar to the following where
the first number changes, ie _1_1 for the first row and the for loop generates _2_1 for the second row...

for loop generates

    <td>
        <img id="pic_1_1"
onclick="changePic('1','1');" src="pic.jpg" />
        <img id="pic_1_2    "
onclick="changePic('1','1');" src="pic.jpg" />
        <img id="pic_1_3"
onclick="changePic('1','1');" src="pic.jpg" />
    </td>

    <td>
        <img id="pic_2_1"
onclick="changePic('2','1');" src="pic.jpg" />
        <img id="pic_2_2"
onclick="changePic('2','1');" src="pic.jpg" />
        <img id="pic_2_3"
onclick="changePic('2','1');" src="pic.jpg" />
    </td>


First I was thinking of using the @Any tag, though I'm
not sure how to inject a counter id into the string?

Thanks in advance,
Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to