93
Views
2
Comments
Solved
Restrict Space using JavaScript
Question

I am creating input box in Reactive App. Need to restrict space bar using javascript. Any one can please help me?

2025-01-24 12-41-20
Vijay Dhasnamoorthy
Solution

$(document).ready(function() {

    $(window).keypress(function(event){

    if(event.keyCode == 32) {

     event.preventDefault();

     return false;

    }

});

});


Use this script on input onkeypress event

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

You can use a function , "Replace"

on input widget onblur property

SyntaxEditor Code Snippet

Replace(Text," ","")

You can also refer the solution here :
https://www.outsystems.com/forums/discussion/66174/remove-special-character-using-extended-properties-onkeypresss/

I hope this will help

Regards

Tousif Khan

2025-01-24 12-41-20
Vijay Dhasnamoorthy
Solution

$(document).ready(function() {

    $(window).keypress(function(event){

    if(event.keyCode == 32) {

     event.preventDefault();

     return false;

    }

});

});


Use this script on input onkeypress event

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

You can use a function , "Replace"

on input widget onblur property

SyntaxEditor Code Snippet

Replace(Text," ","")

You can also refer the solution here :
https://www.outsystems.com/forums/discussion/66174/remove-special-character-using-extended-properties-onkeypresss/

I hope this will help

Regards

Tousif Khan

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.