• 1.
    self.bindEvents = function() {
  • 2.
     
  • 3.
    	self.fieldElems.each(function() {
  • 4.
     
  • 5.
    	    var $targets;
  • 6.
     
  • 7.
    	    // Attempt to target only the quantity input of a Single Product field.
  • 8.
    	    if ($(this).hasClass('gfield_price')) {
  • 9.
    	    $targets = $(this).find('.ginput_quantity');
  • 10.
    							}
  • 11.
     
  • 12.
    	    // Otherwise, target all inputs of the given field.
  • 13.
    	    if( ! $targets.length ) {
  • 14.
    		$targets = $(this).find('inputs');
  • 15.
    	    }
  • 16.
    	    
  • 17.
    	    ........
self.bindEvents = function() { self.fieldElems.each(function() { var $targets; // Attempt to target only the quantity input of a Single Product field. if ($(this).hasClass('gfield_price')) { $targets = $(this).find('.ginput_quantity'); } // Otherwise, target all inputs of the given field. if( ! $targets.length ) { $targets = $(this).find('inputs'); } ........

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter