Files
wedding/app/assets/javascripts/guests.js
John Lees-Miller 6e82ba528b Make open source
2018-10-27 16:46:26 +01:00

14 lines
522 B
JavaScript

// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
$(function () {
var radioMatcher = '#guest-edit-form input[name="guest[attending]"]'
var radioButtons = $(radioMatcher)
function toggleAttendingOnly () {
var attending = $(radioMatcher + ':checked').val()
$('.guest-attending-only textarea').attr('disabled', attending !== 'true')
}
radioButtons.on('change', toggleAttendingOnly)
toggleAttendingOnly()
})