Guest User

Untitled

a guest
Jul 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. (function ($) {
  2. Drupal.behaviors.change_form_fields = {
  3. attach: function(context, settings) {
  4. $('div.form-item-payment-method input').each(function() {
  5. if (this.value != 'existing-bill') {
  6. $('div#' + this.value).css('display', 'none');
  7. }
  8. });
  9.  
  10. $('div.form-item-payment-method input').change(function() {
  11. show_class = this.value;
  12. $('div.form-item-payment-method input').each(function() {
  13. if (this.value != show_class) {
  14. $('input#edit-' + this.value).val('');
  15. $('div#' + this.value).css('display', 'none');
  16. } else {
  17. $('div#' + this.value).css('display', 'block');
  18. }
  19. });
  20. });
  21. }
  22. }
  23. }(jQuery));
  24.  
  25. $("input[type=radio][name=groupname]").change(function(){
  26.  
  27. //Code the clear the form fields or other logic here.
  28. });
Add Comment
Please, Sign In to add comment