hello friends welcome to my channel this
is Sharon in this video I will show you
an asp.net how to validate a text box
control not allowed space using
javascript
so now let's check the final results the
first condition if a mouse Oh notice I'm
not getting any autocomplete exhalation
and entering space the space is not
allowed next edit this one copy this
control I click copy / paste see the
pacing is not working
now let's drag and drop
see the drag-and-drop functionality is
disabled in this text box control if you
are a first-time visitor to my channel
please subscribe to get the latest
updates
for this video tutorial I have created a
new asp.net Rosa
notice in this web form one dot aspx
page contains a simple HTML code with
some heretics h1 headstone horizontal
line and after the horizontal line I
have a text box control now before
adding the functionality not allowed
space in a textbox control using
javascript
let's check the output how it looks at
designing path on the browser and this
is the output of that chord which
condense right now the head relax h1
headstone horizontal line and one text
box control now my aim is I want to
implement a JavaScript functionality not
a load space in a text box control in
this text box control for example if it
types space it's accepting again I'm
adding some spaces which I don't want
any space in this text box control let's
add the functional to JavaScript let's
switch over to the coding part now in
the header section in the web form one
dot aspx page I'm adding scripture and
closing the script I'm creating a
function no space text
you
now in this function I'm adding the
object X
now in this function I'm implementing
the JavaScript the user not allowed a
space in this textbox control
so if object X dot the key core system
is equals to 32
a lot between double chords I'm adding a
string no space allowed
net Xbox
this is the error message I want to
display after that I am adding returned
false after condition returned true
that's it we have added the JavaScript
from Sunday now the last step we need to
add this function name and the textbox
controlled on key down
I'm adding event that's it we have added
the function in this xbox control
let's check the output suppose if I
enter any space in a textbox control I
am getting the alert message or not and
reloading the browser link
after I reel of the browser now let's
enter some text space see here when I
enter space
I've gotten messaged no space allowed if
I enter again space no space allowed in
a textbox control the script is working
perfectly but what I'm doing me if I
enter just uncovering this part copy and
if I paste scissor accepting now let's
disable the cut copy paste in this text
box control switch back to the coding
part again and there are in this text
box control I'm adding the property on
copy return false uncut
electrum files on paste
written files
let's check the output I'm reloading the
browser link again after we added some
properties in the textbox control now if
I type space again I am reading a error
message this time copy and I try to
paste case see the texture is not
pasting in this text box control now the
final step suppose if a user
hello this drag and drop it's working
now let's add the fun started to disable
drag and drop option in this textbox
control and then switch back to the
coding part
and drop this equals to rectum thoughts
and also I'm adding a property I want to
disable the autocomplete Xbox controller
autocomplete is equals to that should
they have done the complete coding part
let's check the results I am reloading
the browser link again let's check the
output so now let's check the final
results the first condition if I'm also
notice I'm not getting any autocomplete
acceleration I'm entering space the
space is not allowed let's delete this
one copy this control I click copy /
paste see the pacing is not parking now
let's drag and drop
see the drag-and-drop functionality is
disabled in this text box control that's
it they have implemented JavaScript
functionality not allowed space in this
text box control