Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ============= Fungsi buat periksa Format URL
- function validUrl($url){
- $format="/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/";
- $url=strtolower($url);
- if(preg_match($format,$url))
- return true; else return false;
- }
- ============= Pas dicek di form
- if(validUrl(document.telvistube.link.value)){
- alert("Format Link Anda Salah. Contoh Format : http://www.youtube.com/QyZZikn");
- form.link.focus();
- return (false);
- }
Advertisement
Add Comment
Please, Sign In to add comment