Welcome, Guest
Username: Password: Remember me

TOPIC: Add an onchange event to a jdom form field

Add an onchange event to a jdom form field 26 May 2014 12:01 #12454

  • andypooz
  • andypooz's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Thank you received: 2
  • Karma: 0
Hi people,
I'm looking for a way to add an onchange event to a radio group. I'd like to do this is the best way. Does the ckradio form field allow for onchange events? I can't find anything, so I'm guessing the answer is no, but it seems like something people might want, so I'm wondering if I can override ckradio to work this in. Not au fait enough with jdom to know how to do this myself, so I'm hoping someone might be able to give me some pointers.

I have tried adding an onchange attribute to the relevant xml file, but that has no effect. I'm wanting to add a show/hide div event, so an onsubmit event for the form isn't any good (In case someone was going to suggest this).
The administrator has disabled public write access.

Add an onchange event to a jdom form field 05 Jun 2014 14:13 #12467

  • andypooz
  • andypooz's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Thank you received: 2
  • Karma: 0
Thanks for all the input guys! :dry:
I did eventually find out a way around this.
My feeble knowledge of js meant that it wasn't immediately apparent to me that I could create a separate listener for a change event from the input itself. So I have something like this:
var jform_wizard = document.getElementById("jform_wizard");
	jform_wizard.onchange = function() {
	var wizval = document.getElementById("jform_wizard").value;
	setActiveDivs(wizval);
	};

which means that an onclick event doesn't need to be added to the input itself.

Now I have another question related to jdom, and I'm hoping for better than 15 views and no responses this time. Wish me luck

Andy
The administrator has disabled public write access.
Time to create page: 0.112 seconds

Get Started