Hey everyone,

TG is my first experience with web app development and my first real
exposure to JavaScript, so please forgive any implicit ignorance in
this question. I'm working through a lot of docs, tutorials and
examples atm but also operating under a fairly tight project
timeframe...

I've managed to attach small pieces of JS functionality to widgets via
the attrs keyword, like so:

            js_clear_default = "if (this.value=='%s') this.value=''"
            js_restore_default = "if (this.value=='') this.value='%s'"

            description = TextArea('description',
                label='Description',
                rows=5, cols=80,
                validator=UnicodeString(not_empty=True, strip=True),
                default=request_default_txt,
                attrs=dict(
                    onFocus=js_clear_default % request_default_txt,
                    onBlur=js_restore_default % request_default_txt,
                    ),
                )

As you can see, I'm referring to 'request_default_txt' several times
where past the initial assignment it would be easier to refer to the
widget.default value. Is this exposed or exposable in any way to the
javascript code once it runs within the template?

Thanks in advance for any help or pointers.

-alex23


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to