Als Deutscher Softwareentwickler in der Schweiz

Landstrasse

Drive your own Way

Share now

Um nur Links zu erlauben die auf „.cfm“ enden, bin ich über die pop()-Funktion von Javascript gestolpert. im Formular rufe ich sie dann per onsubmit=““ auf und je nach dem kann dann das Formular abgeschickt werden oder nicht.

function isValidURL(url) {
  var isOK = url.split(/[.]+/).pop() == 'cfm';
  if (isOK == false) document.getElementById('msg').innerHTML = 'Ziel-Link ungültig!';
  return isOK;
}

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Related Posts

Progressive House

https://www.beatport.com/my-beatport?genres=15

Musikproduktion & DJ Software

Alle Tipps setzen einen iMac oder Mac Book voraus (und auf Wunsch zusätzlich ein iPad): Einsteiger Profi DJay Pro DJ Softwware für Mac, iPad und

X TRA TEC

War wieder eine mega Party im xtra ! https://xtratec.ch/

Get in touch

872 Arch Ave.
Chaska, Palo Alto, CA 55318
hello@example.com
ph: +1.123.434.965

Business inquiries

hello@example.com
ph: +1.321.989.645