You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ugo Cei <ug...@apache.org> on 2005/05/12 17:44:54 UTC

CForms and XHTML

Hi,

I'm currently developing a website which has some forms and of course 
I'm using CForms (2.1.7). The webapp uses the XHTML serializer (XHTML 
1.0 transitional) and this breaks completely the rendering of forms (at 
least using Firefox). if I use the HTML serializer, forms are displayed 
OK but I wouldn't want to switch back to HTML, as the rendering of the 
website is specifically tailored for XHTML.

Before I prepare a longwinded explanation and a bugzilla entry and 
start trying to fix this, I was wondering if someone else has already 
been bitten by this bug and has a quick solution.

	TIA,

		Ugo

-- 
Ugo Cei
Tech Blog: http://agylen.com/
Source.zone: http://sourcezone.info/
Wine & Food Blog: http://www.divinocibo.it/

Re: CForms and XHTML

Posted by Ugo Cei <ug...@apache.org>.
Il giorno 13/mag/05, alle 15:08, Sylvain Wallez ha scritto:

> I see. You may want to try the calendar in window mode, instead of div 
> mode. This just requires to change "new 
> CalendarPopup('forms_calendarDiv')" to "new CalendarPopup()". That 
> way, the calendar will output is non-xhtml stuff in a separate window.

Well, the calendar is not by biggest problem. I will probably use this 
[1] calendar instead, and I have just a couple date fields that could 
live without a calendar widget at all, to be honest. My biggest problem 
at the moment is the HTMLArea widget.

For the time being, I resorted to using the HTML serializer, with a 
simplified layout and CSS, for pages containing forms. The rest of the 
site is still XHTML. It's not an optimal solution but it works.

	Ugo

[1]: http://www.dynarch.com/projects/calendar/

-- 
Ugo Cei
Tech Blog: http://agylen.com/
Source.zone: http://sourcezone.info/
Wine & Food Blog: http://www.divinocibo.it/

Re: CForms and XHTML

Posted by Sylvain Wallez <sy...@apache.org>.
Ugo Cei wrote:

> Il giorno 13/mag/05, alle 14:19, Sylvain Wallez ha scritto:
>
>> Why? Because it's too much work?
>>
>> My impression is that once we have an xhtml-compliant CForms, it will 
>> be easier to have it run on HTML browsers.
>
>
> Because I'm worried about having to dive into Matt Kruse's JS code. 
> I'm no Javascript/DHTML guru.


I see. You may want to try the calendar in window mode, instead of div 
mode. This just requires to change "new 
CalendarPopup('forms_calendarDiv')" to "new CalendarPopup()". That way, 
the calendar will output is non-xhtml stuff in a separate window.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: CForms and XHTML

Posted by Ugo Cei <ug...@apache.org>.
Il giorno 13/mag/05, alle 14:19, Sylvain Wallez ha scritto:

> Why? Because it's too much work?
>
> My impression is that once we have an xhtml-compliant CForms, it will 
> be easier to have it run on HTML browsers.

Because I'm worried about having to dive into Matt Kruse's JS code. I'm 
no Javascript/DHTML guru.

	Ugo

-- 
Ugo Cei
Tech Blog: http://agylen.com/
Source.zone: http://sourcezone.info/
Wine & Food Blog: http://www.divinocibo.it/

Re: CForms and XHTML

Posted by Sylvain Wallez <sy...@apache.org>.
Ugo Cei wrote:

> I did some tests and this is what I came up with:
>
> The main problem seems to be that the browser is confused by empty 
> <script /> tags. This is easily fixed by something like:
>
> <script src="...">
>   <xsl:comment> filler </xsl:comment>
> </script>
>
> in the CForms sample stylesheets.
>
> Then you have to have HTML elements in the XHTML namespace 
> (http://www.w3.org/1999/xhtml), or you'll see a blank page. This also 
> means that the stylesheets must be modified to react on 
> namespace-qualified "head" and "body" elements.
>
> Once you've done this, the form can be seen and works ... mostly.
>
> What does not work now are popup calendars and the HtmlArea widget :(
>
> Assuming I can fix them, this will be for Firefox only, since I don't 
> have a windows machine for testing with IE.
>
> Frankly, I'm thinking about switching back to HTML.


Why? Because it's too much work?

My impression is that once we have an xhtml-compliant CForms, it will be 
easier to have it run on HTML browsers.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: CForms and XHTML

Posted by Ugo Cei <ug...@apache.org>.
I did some tests and this is what I came up with:

The main problem seems to be that the browser is confused by empty 
<script /> tags. This is easily fixed by something like:

<script src="...">
   <xsl:comment> filler </xsl:comment>
</script>

in the CForms sample stylesheets.

Then you have to have HTML elements in the XHTML namespace 
(http://www.w3.org/1999/xhtml), or you'll see a blank page. This also 
means that the stylesheets must be modified to react on 
namespace-qualified "head" and "body" elements.

Once you've done this, the form can be seen and works ... mostly.

What does not work now are popup calendars and the HtmlArea widget :(

Assuming I can fix them, this will be for Firefox only, since I don't 
have a windows machine for testing with IE.

Frankly, I'm thinking about switching back to HTML.

	Ugo

-- 
Ugo Cei
Tech Blog: http://agylen.com/
Source.zone: http://sourcezone.info/
Wine & Food Blog: http://www.divinocibo.it/

Re: CForms and XHTML

Posted by Sylvain Wallez <sy...@apache.org>.
Ugo Cei wrote:

> Hi,
>
> I'm currently developing a website which has some forms and of course 
> I'm using CForms (2.1.7). The webapp uses the XHTML serializer (XHTML 
> 1.0 transitional) and this breaks completely the rendering of forms 
> (at least using Firefox). if I use the HTML serializer, forms are 
> displayed OK but I wouldn't want to switch back to HTML, as the 
> rendering of the website is specifically tailored for XHTML.
>
> Before I prepare a longwinded explanation and a bugzilla entry and 
> start trying to fix this, I was wondering if someone else has already 
> been bitten by this bug


Yes

> and has a quick solution.


No, because of lack of time to invesigate. If you have some, go ahead!

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: CForms and XHTML

Posted by Marco Rolappe <m_...@web.de>.
hi,

encountered the same problem. my rough idea, before also switching to 
the html serializer, was that somehow the order of stuff in <head> seems 
to be important, and using cforms the stylesheets wildly mixed <link>s 
and <script>s.

Ugo Cei schrieb:
> Hi,
> 
> I'm currently developing a website which has some forms and of course 
> I'm using CForms (2.1.7). The webapp uses the XHTML serializer (XHTML 
> 1.0 transitional) and this breaks completely the rendering of forms (at 
> least using Firefox). if I use the HTML serializer, forms are displayed 
> OK but I wouldn't want to switch back to HTML, as the rendering of the 
> website is specifically tailored for XHTML.
> 
> Before I prepare a longwinded explanation and a bugzilla entry and start 
> trying to fix this, I was wondering if someone else has already been 
> bitten by this bug and has a quick solution.
> 
>     TIA,
> 
>         Ugo
>