Difference between revisions of "MediaWiki:Common.js"
From Thermodynamics of Computation
WikiWorks2 (talk | contribs) |
WikiWorks2 (talk | contribs) |
||
Line 7: | Line 7: | ||
function runQueryOnABCChange(){ | function runQueryOnABCChange(){ | ||
$('input[name="Reference Material Query ABC[index]"], input[name="Reference Material Query[index]"]').each(function(){ | $('input[name="Reference Material Query ABC[index]"], input[name="Reference Material Query[index]"]').each(function(){ | ||
− | $(this).eq(0).hide(); | + | $(this).eq(0).parent().hide(); |
$(this).on('change', function() { | $(this).on('change', function() { | ||
var $form = $(this).closest('form'); | var $form = $(this).closest('form'); |
Revision as of 12:06, November 30, 2018
/* Any JavaScript here will be loaded for all users on every page load. */ $(document).ready(function() { runQueryOnABCChange() }); function runQueryOnABCChange(){ $('input[name="Reference Material Query ABC[index]"], input[name="Reference Material Query[index]"]').each(function(){ $(this).eq(0).parent().hide(); $(this).on('change', function() { var $form = $(this).closest('form'); $form.find('input[type=submit]').click(); }); }); }