Skip to main content
Question

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

  • October 25, 2018
  • 0 replies
  • 50 views

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?
This topic has been closed for replies.

  • Registered
  • November 5, 2018
Post your code.

  • Author
  • Registered
  • November 5, 2018
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.


  • Registered
  • November 5, 2018
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: