Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
3.6 kB
2
Indexable
Never
```js
<script>
  $("#concert-type").change(function() {
    if ($(this).val() === "full-band") {
      $("#full-band-options").show();
      $("#acoustic-band-options").hide();
      $("#acoustic-solo-options").hide();
    } else if ($(this).val() === "acoustic-band") {
      $("#acoustic-band-options").show();
      $("#full-band-options").hide();
      $("#acoustic-solo-options").hide();
    } else if ($(this).val() === "acoustic-solo") {
      $("#acoustic-band-options").hide();
      $("#full-band-options").hide();
      $("#acoustic-solo-options").show();
    }
  });
  
  var birthdayInput = document.getElementById("Birthday-Age");
  
  $(document).on('keyup', '#Birthday-Age', function() {
    console.log('changed');
    if ($("#Birthday-Age").val() > 1) {
      $("input[type='radio'][name='Party-Type']").removeAttr("checked");
      $('#250').prop('checked', true);
      $('#theme-question').show();
      $('#under-3-question').show();
      $('#child-amount-question').show();
      $('#150').parent().hide();
    } else {
      $('#150').parent().show();
    }
  });
  
  const id = 'booking-form-list';
  const yOffset = -120; 
  const element = document.getElementById(id);
  const y = element.getBoundingClientRect().top + window.pageYOffset + yOffset;


  $('.concert-btn').click(function(){
    $('#concert-form').show();
    $('#music-classes-form').hide();
    $('#professional-development-form').hide();
    $('#birthday-party-form').hide();
    $('#hot-toast-song-form').hide();
    $('#contact-form').hide();
		window.scrollTo({top: y, behavior: 'smooth'});
  })

  $('.music-classes-btn').click(function(){
    $('#concert-form').hide();
    $('#music-classes-form').show();
    $('#professional-development-form').hide();
    $('#birthday-party-form').hide();
    $('#hot-toast-song-form').hide();
    $('#contact-form').hide();
		window.scrollTo({top: y, behavior: 'smooth'});
  })

  $('.professional-development-btn').click(function(){
    $('#concert-form').hide();
    $('#music-classes-form').hide();
    $('#professional-development-form').show();
    $('#birthday-party-form').hide();
    $('#hot-toast-song-form').hide();
    $('#contact-form').hide();
		window.scrollTo({top: y, behavior: 'smooth'});
  })

  $('.birthday-party-btn').click(function(){
    $('#concert-form').hide();
    $('#music-classes-form').hide();
    $('#professional-development-form').hide();
    $('#birthday-party-form').show();
    $('#hot-toast-song-form').hide();
    $('#contact-form').hide();
		window.scrollTo({top: y, behavior: 'smooth'});
  })

  $('.song-btn').click(function(){
    $('#concert-form').hide();
    $('#music-classes-form').hide();
    $('#professional-development-form').hide();
    $('#birthday-party-form').hide();
    $('#hot-toast-song-form').show();
    $('#contact-form').hide();
		window.scrollTo({top: y, behavior: 'smooth'});
  })
  
  $('#contact-btn').click(function(){
    $('#concert-form').hide();
    $('#music-classes-form').hide();
    $('#professional-development-form').hide();
    $('#birthday-party-form').hide();
    $('#hot-toast-song-form').hide();
    $('#contact-form').show();
		window.scrollTo({top: y, behavior: 'smooth'});
  })
  
  $('input[type=radio][name=Party-Type]').change(function() {
    if (this.value == '$250') {
      $('#theme-question').show();
      $('#under-3-question').show();
      $('#child-amount-question').show();
    } else {
      $('#theme-question').hide();
      $('#under-3-question').hide();
      $('#child-amount-question').hide();
    }
  })
</script>
```