Adding a class attribute to form label
dmolavi
Joined: 2002-12-05
Posts: 573 |
Posted: Thu, 2011-01-13 15:21 |
I'm updating the ecard module, and finally have the JS counter working, enforcing a max length on the message. I'm trying to get the counter to display, but since the form is rendered all at once, I can't find a way to simply insert a string (that doesn't have an associated input) anywhere to show the user. The workaround I found was to assign a class to the textarea's label. The Kohana docs say it should be possible, but when I try: $group->textarea("text") ->label(t("Message"), array("class" => "charsRemaining")) ->id("g-text") ->maxlength(255) ->rules("required") ->error_messages("required", t("You must enter a message")); The class is never assigned to the label. Is there a way to do this in the G3 framework? -- |
|
Posts: 27300
just guessing here:
just a guess though. I'll ping bharat.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 573
That assigns the class to the textarea, not the label.
--
For Gallery 3 modules and themes, visit GalleryModules.com.
For PHPNuke, phpBB2, and phpBB3 integration help, visit NukedGallery.net.
Posts: 7994
You can use jQuery to find the right element once you have the class of the textarea...
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 2466
it would be much slower than CSS
Posts: 573
Yeah, I was kinda hoping to avoid jQuery to make this change, and have it done straight in CSS. It's OK for now, though, the little counter just doesn't show a real-time value for how many characters are left.
--
For Gallery 3 modules and themes, visit GalleryModules.com.
For PHPNuke, phpBB2, and phpBB3 integration help, visit NukedGallery.net.