JSFiddle - React, Tailwind, and code Playground

by Joe

HTML

<input type="radio" id="need_staff_on_site" name="data[CaterRequest][need_staff_on_site]" value="yes" class="staff_on_site"><span>Yes</span>

How many staff?<input type="text" maxlength="3" id="no_of_staff" name="data[CaterRequest][staff_needed]" class="txtboxSml2">

JavaScript

$(document).ready(function() {

  $('.staff_on_site').click(function() {

    var rBtnVal = $(this).val();

    if (rBtnVal == "yes") {
      $("#no_of_staff").attr("readonly", true);
    } else {
      $("#no_of_staff").attr("readonly", false);
    }
  });
});