Skip to content
PHPCODER.TECH
Code for All <?= ?>
Tools
PHP Editor
Letter and Word Counter
IP Lookup
FB Video Downloader
Frameworks
Laravel
Codeigniter
How To
PHP
PHP Beginners
WordPress
HTML/CSS Codes
My Store
PHP Books
Watch Store
Mobile Store
All Articles
Questions
PHPCODER.TECH
Code for All <?= ?>
Toggle Navigation
Toggle Navigation
Tools
PHP Editor
Letter and Word Counter
IP Lookup
FB Video Downloader
Frameworks
Laravel
Codeigniter
How To
PHP
PHP Beginners
WordPress
HTML/CSS Codes
My Store
PHP Books
Watch Store
Mobile Store
All Articles
Questions
Home
»
Questions
»
Restrict space at first position in textarea using jquery javascript
Restrict space at first position in textarea using jquery javascript
132 views
March 10, 2021
0
Dev (anonymous)
March 10, 2021
0
Comments
Restrict space at first position in textarea using jquery javascript
Advertisement
Bikash
Changed status to publish
March 10, 2021
Add a Comment
1
Answer
Active
Voted
Newest
Oldest
0
Bikash
0
Posted March 10, 2021
0
Comments
<input type="text"> <script> $("input").on("keypress", function(e) { if (e.which === 32 && !this.value.length){ e.preventDefault(); alert("Space at first position is not allows."); }else{ } }); </script>
1
2
3
4
5
6
7
8
9
10
11
12
<
input
type
=
"text"
>
<script>
$
(
"input"
)
.
on
(
"keypress"
,
function
(
e
)
{
if
(
e
.
which
===
32
&&
!
this
.
value
.
length
)
{
e
.
preventDefault
(
)
;
alert
(
"Space at first position is not allows."
)
;
}
else
{
}
}
)
;
</script>
Advertisement
Bikash
Changed status to publish
March 10, 2021
Add a Comment
Write your answer.
Register
or
Login
Advertisement
Facebook
Twitter
LinkedIn
Reddit
WhatsApp
Email
mariobet
-
supertotobet
-
escort