cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: XMLForm & JavaScript incompatibility
Date Wed, 23 Apr 2003 07:14:29 GMT
Use this:

document.forms[0].elements["/root/field"];

or this (if you set the 'id' attribute):

document.getElementById("/root/field");

--
  Konstantin

From: "Yatin Shah" <nospam@kripa.com>

> JavaScript incompatibility results when using
> XMLForm with a xf:group option or when the
> ref argument refers to a name containing the slash character('/').
>
> This becomes an issue if one desires to use javascript features
> to access and manipulate the state of input fields.
> In the example below, '/activityForm/DBdata/startDate' is an
> invalid JavaScript name.[Although, it's a proper jxpath name!]
>
> Apurva zaveri [1] had a similar issue. Does anyone know
> how to get around this problem?
>
>
> SAMPLE XMLFORM code
> -------------------
>
> <xf:group ref="/activityForm/DBdata">
>     <xf:textbox ref="startTime">
>       <xf:caption>Start Time</xf:caption>
>       <xf:violations class="error"/>
>     </xf:textbox>
> </xf:group>
>
> Resulting HTML
> --------------
>
> <input name="/activityForm/DBdata/startDate" type="textbox"
value="2002-09-23">
>
>
> [1]:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&w=2&r=1&s=xmlform+JavaScrip
t&q=b
>
>
> --
> Yatin Shah, President                       mailto:ygs@kripa.com
> Kripa Inc.                                  http://www.kripa.com
> Dayton, New Jersey USA                      phone:  732.329.8303
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Developers of real time event driven distributed DB application
>
>
>


Mime
View raw message