Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
JAVA SCRIPT HELP II
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="viraj_slk" data-source="post: 7365515" data-attributes="member: 51932"><p><span style="font-size: 12px">bro, you have taken a good effort to solve this one. good work. keep improving your answer to get better results. </span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">if((v== "")|| (v.length < 9)) is okay. but it becomes true even if the use has entered less than 9 characters (and greater than 0). a better way to do this might be:</span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">if (v.length != 9) neda? </span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">and also start thinking a bit about regular expressions. they are very very handy when using js. it takes some time to learn but once u master them, u can do many things. even i have forgotten them now but should pick up.</span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">for example your current code will say it's correct even if the use entered ABCD-ABCD OR 1234-1234 OR 1234-ABCD, neda? Regular expressions may be the best and most effective way to check for the validity of the string according to user specified rules like yours. so Google it up and give it a try</span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">but u have started well! keep improving to fix the mistakes. that's how u will write a great rego. number checker! <img src="/styles/default/xenforo/smilies/default/happy.gif" class="smilie" loading="lazy" alt=":)" title="Happy :)" data-shortname=":)" /></span></p><p><span style="font-size: 12px"></span></p></blockquote><p></p>
[QUOTE="viraj_slk, post: 7365515, member: 51932"] [SIZE="3"]bro, you have taken a good effort to solve this one. good work. keep improving your answer to get better results. if((v== "")|| (v.length < 9)) is okay. but it becomes true even if the use has entered less than 9 characters (and greater than 0). a better way to do this might be: if (v.length != 9) neda? and also start thinking a bit about regular expressions. they are very very handy when using js. it takes some time to learn but once u master them, u can do many things. even i have forgotten them now but should pick up. for example your current code will say it's correct even if the use entered ABCD-ABCD OR 1234-1234 OR 1234-ABCD, neda? Regular expressions may be the best and most effective way to check for the validity of the string according to user specified rules like yours. so Google it up and give it a try but u have started well! keep improving to fix the mistakes. that's how u will write a great rego. number checker! :) [/SIZE] [/QUOTE]
Insert quotes…
Verification
Haya warak paha keeyada? (haya wadi kireema paha)
Post reply
Top
Bottom