Disabled Space Bar When Cursor Inside Text Field

$(document).ready(function() { $('input.some_text_field').keydown(function(e) { if (e.keyCode == 32) { return false; } }); });
Disabled Space Bar When Cursor Inside Text Field just add or match the class at $('input.some_text_field').

2 Responses

Pure HTML version :)

<input type="text" pattern="\S+" required>

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.