jquery : barcode triggers submit
Our cataloging department liked the short-lived behavior in 3.14 where scanning barcodes would submit forms [ no one else did ]. I decided to try and reintroduce that for the cataloging module only -- testing using greasemonkey. Here's what I've got so far [ doesn't work ]: $('tag_952_subfield_p_971027').keypress(function(e) { if ( e.which == 13 ) { $( "input[value='Save changes']").trigger('click'); } }); Any ideas? Thanks! Chad -- Chad Roseburg Automation Dept. North Central Regional Library
Hie, This behavior is added by the JS code : $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); A better solution is to remove this class : $("tag_952_subfield_p_971027").removeClass("noEnterSubmit"); Le 22/07/2014 23:20, Chad Roseburg a écrit :
Our cataloging department liked the short-lived behavior in 3.14 where scanning barcodes would submit forms [ no one else did ]. I decided to try and reintroduce that for the cataloging module only -- testing using greasemonkey.
Here's what I've got so far [ doesn't work ]: $('tag_952_subfield_p_971027').keypress(function(e) { if ( e.which == 13 ) { $( "input[value='Save changes']").trigger('click'); } });
Any ideas?
Thanks!
Chad
-- Fridolin SOMERS Biblibre - Pôles support et système fridolin.somers@biblibre.com
Chad,
A better solution is to remove this class : $("tag_952_subfield_p_971027").removeClass("noEnterSubmit");
And, of course, you will need a valid selector. 971027 is a random number, and the "tag_952..." is an id and not a tag name. Something like $('input[id^="tag_952_subfield_p"]') might serve you better. Regards, Jared -- Jared Camins-Esakov Bibliographer, C & P Bibliography Services, LLC (phone) +1 (917) 727-3445 (e-mail) jcamins@cpbibliography.com (web) http://www.cpbibliography.com/
participants (3)
-
Chad Roseburg -
Fridolin SOMERS -
Jared Camins-Esakov