JFormFieldList and onchange behavior

180 views
Skip to first unread message

Christophe Demko

unread,
Jan 2, 2010, 10:10:46 PM1/2/10
to Joomla! CMS Development
Would it be possible to add a "onchange" attribute to the
JFormFieldList class?
I propose a patch in http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=19231

Ch.D

Andrew Eddie

unread,
Jan 3, 2010, 11:26:24 PM1/3/10
to joomla-...@googlegroups.com
Done.

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer


2010/1/3 Christophe Demko <chd...@gmail.com>:

> --
>
> You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-...@googlegroups.com.
> To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
>
>
>

Beat

unread,
Jan 7, 2010, 6:37:37 PM1/7/10
to Joomla! CMS Development
Hi Christophe,
Hi Andrew,

Interesting idea: my 3 cents/remarks:

1) There is a small bug: a space missing before "onchange" in the
patch, making that attribute syntaxically incorrect.

2) The onchange should not be handled within the body html as an
attribute, but handled in the <head> section where javascript belongs,
and attached to the id.

3) Result of this is that now javascript code is mixed into XML file
and into HTML.

To be able to do same effect in a clean way, it would be more useful
to be able to set the id attribute to the element(s), and then
reference them from any JS file to attach too (more modern JS
approach).

Best Regards,
Beat
http://www.joomlapolis.com/


On Jan 4, 5:26 am, Andrew Eddie <mambob...@gmail.com> wrote:
> Done.
>
> Regards,
> Andrew Eddiehttp://www.theartofjoomla.com- the art of becoming a Joomla developer
>
> 2010/1/3 Christophe Demko <chde...@gmail.com>:


>
>
>
> > Would it be possible to add a "onchange" attribute to the
> > JFormFieldList class?

> > I propose a patch inhttp://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEd...

Andrew Eddie

unread,
Jan 8, 2010, 12:52:12 AM1/8/10
to joomla-...@googlegroups.com
2010/1/8 Beat <bea...@gmail.com>:

> Hi Christophe,
> Hi Andrew,
>
> Interesting idea: my 3 cents/remarks:
>
> 1) There is a small bug: a space missing before "onchange" in the
> patch, making that attribute syntaxically incorrect.

Fixed.

> 2) The onchange should not be handled within the body html as an
> attribute, but handled in the <head> section where javascript belongs,
> and attached to the id.

You don't have to use it if you don't want to and it's still a valid
attribute of the tag.

> 3) Result of this is that now javascript code is mixed into XML file
> and into HTML.

I'd generally agree, but the form fields can be manipulated by plugins.

> To be able to do same effect in a clean way, it would be more useful
> to be able to set the id attribute to the element(s), and then
> reference them from any JS file to attach too (more modern JS
> approach).

If you want to devise a way of doing that I'd be most happy to look at it :)

Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer

Christophe Demko

unread,
Jan 8, 2010, 2:53:51 AM1/8/10
to Joomla! CMS Development

>
> If you want to devise a way of doing that I'd be most happy to look at it :)
>

I solve partially this problem in the jform-jparameter branch
(referencing a field in his own form)

Ch.D

Christophe Demko

unread,
Jan 8, 2010, 4:54:51 AM1/8/10
to Joomla! CMS Development
Reply all
Reply to author
Forward
0 new messages