Javascript examples for DOM HTML Element:Form Event
Match string start for 'http://' in input
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function checkUR(abc){//from ww w.jav a 2 s . com string = abc.value if(!(/^http:\/\//.test(string))){ string = "http://" + string; } abc.value=string } </script> </head> <body> <form> <input type="url" name="someUrl" onkeyup="checkUR(this)"> </form> </body> </html>