Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

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).

Please Log in or Create an account to join the conversation.

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

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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.093 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started