3

I have a lengthy form config for my widget so I thought about using radio buttons to hide and show the relevant input fields instead of having them all after each other. But it doesn't seem to work. I suppose it is because the form is loaded with ajax? Is there a way to get it to work?

Take a look at the code here: http://jsfiddle.net/JmVL3/

6
  • What does your browser's debugger say?
    – fuxia
    Commented Sep 26, 2012 at 22:59
  • It doesn't say anything. Neither firebug or chrome gives any errors. I've just noticed that it works fine to alert a message instead of hiding/showing the input field when clicking the radio buttons.
    – John
    Commented Sep 26, 2012 at 23:05
  • It also works everywhere else on the admin page. Just not inside the widget settings. I tried to use .ajaxsucces() around the code but it didn't seem to help.
    – John
    Commented Sep 26, 2012 at 23:13
  • Another thing. It also works if i enable accessibility mode.
    – John
    Commented Sep 26, 2012 at 23:23
  • @toscho, I can reproduce the issue, it is possible to see the manipulations happening in the Html code (i.e.: $("#field2").css('display','block');), but the widget form shows no change...
    – brasofilo
    Commented Nov 10, 2012 at 23:30

1 Answer 1

1

I just had the same issue, which I resolved by changing all my IDs to classes. Remember that widgets can be used multiple times on page, so specifying an ID anywhere increases the likelihood that you'll have ID duplication (Which will in turn cause jQuery to have a fit).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.