hi kangax,
thanks for the help it really save me a lot of time ..
unfortunately i have more problem from using observe ...
it is because the design of my current work.
which is a very very dynamic page
eg
observe('focus', function(){highlight("indicator1"+topPatCnt)})
topPatCnt is a incrementing number which keep increase once the
dynamic form get added.
highlight is a function which highlights the filed once the cell is
clicked
from my experience so far correct me if i am wrong, observe runs like
real time, it calls highlight function on-the-fly once the cell is
clicked.
as a result it always highlights the last topPatCnt form
that is if you have form A, B, C, D and E
if you click on the cell in form B it insteads of highlighting cell in
form B it highlights cell in form E because topPatCnt is 5
is there any prototype to fix my issue?
do you get my problem? let me know if you need more information as it
took a while for me to explain the problem to my manager as well.
thanks in advance.
On Nov 20, 4:35 pm, kangax <[EMAIL PROTECTED]> wrote:
> I'm not sure what you want "this" to be (in callbacks), but something
> like is what you might consider:
>
> var td6Input = $(td6).insert(
> new Element('input', {
> size: 2,
> maxLength: 2,
> name: "txtDateOfServDay" + seq,
> id: "txtDateOfServDay" + seq
> }).observe('keyup', function(){ KeyButtonPress(this, event, 2) })
> .observe('change', function(){ checkDay(this) })
> )
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---