[Html-widget] HTML::Widget and Images inside the <form>

Krzysztof Krzyzaniak eloy at kofeina.net
Thu Jul 20 16:49:42 CEST 2006


Roland Moriz wrote:
> Hi,
> 
> what's the best way to include an image into a form?
> 
> For example:
> 
> I've a text field with a label where the user should enter the provided
> security code (from captcha image). The captcha should be displayed
> within the form above the corresponding text field (<img src="..."/>).
> 
> I tried CSS's :before and :after attributes but they are not that wide
> supported to use them in general usage (because of !IE).
> 
> Any hints?

I've used span with hack

in widget:
$w->element('Span', 'captcha')->class('captcha');

in template:
[% IF element.element.id == 'form_captcha'  -%]
<label>
<img src="[% c.uri_for(captchaimg) %]" alt="captcha" width="80"
height="30" border="0"  />
</label>
[% END %]

hack is because you cannot put HTML content into span element.

  eloy
-- 
-------e-l-o-y---------------------------e-l-o-y- at -k-o-f-e-i-n-a-.-n-e-t------

       jak to dobrze, że są oceany - bez nich byłoby jeszcze smutniej



More information about the Html-widget mailing list