Hello, I have two inputs and when im write on the first input, with the jquery keyup im function that automatically writes in the second input field.
But I want to write a line instead of a space in the second input field when im presses a space.
For instance:
First entry: Hello world,
Second Entry: Hello-world
I have the following code:
$(".firstInput").keyup(function(e) {
val = $(this).val();
if( e.keyCode == 32 ) {
val += "-";
}
$(".secondInput").val( val );
});
Özkan source
share