How to validate youtube url in client side in text box
Here is the code which validates the youtube url- function validateYouTubeUrl() { var url = $(‘#youTubeUrl’).val(); if (url != undefined || url != ”) { var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=|\?v=)([^#\&\?]*).*/; var match = url.match(regExp); if (match && match[2].length == 11) { // Do anything for being valid // if need to change the url to embed … Read more