Discussions

Expand all | Collapse all

Cannot get a change event to fire for multiple-choice text field displayed as radio buttons

  • 1.  Cannot get a change event to fire for multiple-choice text field displayed as radio buttons

    Posted 10-25-2018 18:37
    I have a multi-choice text field.  I've written a small snippet of code that performs some action based on what the user has chosen in that field (an "onchange" event).  The code works fine when the field is displayed as a multi-choice text field on the form.  Once it change it to "dispaly choices as radio buttons", the code no longer works.  The "onchange" event no longer fires.  I've tried the "click" event, but that does not fire either.

    Has anyone else encountered this problem?


  • 2.  RE: Cannot get a change event to fire for multiple-choice text field displayed as radio buttons

    Top
    Contributor
    Posted 11-04-2018 23:16
    Post your code.


  • 3.  RE: Cannot get a change event to fire for multiple-choice text field displayed as radio buttons

    Posted 11-05-2018 15:52
    if (/a=nwr/i.test(querystring)) {
        $("#_fid_43").attr("readonly", "true");

        $("#_fid_27").on("change", function() {

    switch($(this).val()) {

         blah, blah, blah


    fid_27 is currently a multi-choice text field.  On the form, if I select the option to display this field as radio buttons, the OnChange event never fires.  I've also tried the OnClick event and that does not work either.



  • 4.  RE: Cannot get a change event to fire for multiple-choice text field displayed as radio buttons

    Top
    Contributor
    Posted 11-05-2018 16:59
    With the field displayed as options this code works:
    $("#_fid_6")
      .on("change", function() {
        console.log(this.value)
      });
    With the field displayed as radio buttons this code works:
    $("input[type=radio][name=radio_fid_6]")
      .on("change", function() {
        console.log(this.value);
      });
    I should note that the HTML QuickBase spits out for the radio buttons is malformed and produces this message in the console: