side-area-logo

Yuzawa – Gateway to Niigata Prefecture

jQuery(document).ready(function(e) { var wpcf7Elm = document.querySelector( '.wpcf7-form' ); wpcf7Elm.addEventListener( 'submit', function( event ) { if (event.which == 13) { console.log(" .wpcf7-form triggered "); event.preventDefault(); var s= jQuery('textarea').val(); jQuery(this).val(s+"\n"); } }, false ); jQuery('textarea').keypress(function(event) { if (event.which == 13) { console.log(" textArea new line "); event.preventDefault(); var s = $(this).val(); jQuery(this).val(s+"\n"); } }); jQuery(window).keydown(function(event){ if(event.keyCode == 13) { console.log(" keydown preventDefault() "); event.preventDefault(); return false; } }); jQuery(window).keypress(function(event){ if(event.keyCode == 13) { console.log(" keypress preventDefault() "); event.preventDefault(); return false; } }); });
$('form input:not([type="submit"])').keydown(function(e) { if (e.keyCode == 13) { var inputs = $(this).parents("form").eq(0).find(":input"); if (inputs[inputs.index(this) + 1] != null) { inputs[inputs.index(this) + 1].focus(); } e.preventDefault(); return false; } });