W3C home > Mailing lists > Public > www-forms@w3.org > March 2005

Re: Button with an image.

From: Stefano Debenedetti <ste@demaledetti.net>
Date: Wed, 23 Mar 2005 12:20:54 +0100
Message-ID: <42415116.1030008@demaledetti.net>
To: www-forms@w3.org

Borja Bravo Alférez ha scritto:
[...]
> Anne said that it i possible to use CSS to format form. I am sure that 
> standard html buttons can be formated like an image but may be i should 
> had made clear that it needed to be a xform button (trigger or 
> submit).Anyway, Xforms are supposed to be formatted with CSS although I 
> have found some problems. But Is there any way of formatting the Xform 
> button to display an image instead of the label?

Provided that your chosen browser has a decent CSS implementation (mozilla/ff), fully styling of XForms with CSS should work with ugo/deng2:

http://demaledetti.net/ugo/examples/flashless_deng/sample_xforms.html

Not sure how to fully replace the label with an image, in the example above I used a background so that it degrades well on not so good CSS implementations (IE) anyway.

ciao
ste

p.s. please be aware that ugo's XForms implementation is still (very) beta

> I include a trimmed down example at the end. I am afraid that it won't 
> be perfect XHTML as I can't validate it with the Xforms. I accept 
> suggestions to make it more standard compliant anyway.  There you can 
> see that the h and xf namespaces refer to xhtml 1.0 transitional and 
> xforms1.0. Do I forget anything? Yes, the original thread in this list was:
>    http://lists.w3.org/Archives/Public/www-forms/2005Mar/0066.html
> 
> I hope you all have all the information need,  thank you for everything
> 
> Regards,
> 
> Borja
> 
> 
> 
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//ES"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 
> <html xmlns="http://www.w3.org/2002/06/xhtml2"
> xmlns:h="http://www.w3.org/2002/06/xhtml2"
> xmlns:xf="http://www.w3.org/2002/xforms">
> 
> <head>
>  <title>Artículos</title>
>    <xf:model>
>         <xf:submission id="s1" method="post" 
> action="http://xforms.dstc.edu.au/cgi-bin/test.cgi"/>
>    </xf:model>
> </head>
> <body>
>        <xf:submit  submission="save">
>            <xf:label>Salvar</xf:label>
>        </xf:submit>
> 
>        <xf:submit appearance="minimal">
>            <xf:label> <h:img src="../images/articulos_small.jpg" 
> alt="articulo" /></xf:label>
>       </xf:submit>
> 
>        <xf:trigger appearance="minimal">
>            <xf:label> <h:img src="../images/articulos_small.jpg" 
> alt="articulo" /></xf:label>
>        </xf:trigger>
> </body>
> </html>
> 
> 
> 
Received on Wednesday, 23 March 2005 11:18:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:00 GMT