Skip to content

Instantly share code, notes, and snippets.

@mk-pmb
Last active November 12, 2017 12:49
Show Gist options
  • Save mk-pmb/0478a53be43fa41ee60567b909d9e420 to your computer and use it in GitHub Desktop.
Save mk-pmb/0478a53be43fa41ee60567b909d9e420 to your computer and use it in GitHub Desktop.
function clearRightOf(field) {
if (!window.confirm('Clear cells right of trigger field?')) { return; }
window.lastClearRightTrigger = this;
var right = jQuery(field).parent().nextAll();
right.find('input').val('');
right.find('select').prop('selectedIndex', 0);
window.alert('Should be cleared now, look before you then click ok.');
}
jQuery(document).ready(function () {
jQuery('table#tblProducts').on('change', 'select, input.pnm',
function () { clearRightOf(this); });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment