Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JavaScript Phone (only numbers)

Featured Replies

Hi, I need a little help,

I'm not very good in programming tho (My one of the serious attempt:P)

How do I aplly only numbers? (max. 10)

if (document.formulier.telefoonnummer.value == "") {
document.getElementById('telefoonnummer').innerHTML = "please insert your phonenumber";
document.getElementById('8').innerHTML = "!";
}
else
{
if (document.formulier.telefoonnummer.value.length < 10) {
document.getElementById('telefoonnummer').innerHTML = "please insert a valid phonenumber!";
document.getElementById('8').innerHTML = "!";

What shall I do?

Thanks and sorry for bad English :P


Check out this page for your reference.

I think it has what you need to accomplish your needs.

Advanced JavaScript Stuff

You might want to use the

parseInt() and isNaN() functions or whatever you call them inorder to check if it is a number or not.

and

if your numbers, since its a phone number, might include hiphens "-" and / or "(", ")" inside them, use the str.replace() function to accomplish it.

Have Fun!

  • Author

Thanks, this might become handy... reading right now :thumbup

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.