Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ($) {
- Drupal.behaviors.change_form_fields = {
- attach: function(context, settings) {
- $('div.form-item-payment-method input').each(function() {
- if (this.value != 'existing-bill') {
- $('div#' + this.value).css('display', 'none');
- }
- });
- $('div.form-item-payment-method input').change(function() {
- show_class = this.value;
- $('div.form-item-payment-method input').each(function() {
- if (this.value != show_class) {
- $('input#edit-' + this.value).val('');
- $('div#' + this.value).css('display', 'none');
- } else {
- $('div#' + this.value).css('display', 'block');
- }
- });
- });
- }
- }
- }(jQuery));
- $("input[type=radio][name=groupname]").change(function(){
- //Code the clear the form fields or other logic here.
- });
Add Comment
Please, Sign In to add comment