0

I have an HTML form, method='post' with enctype="application/x-www-form-urlencoded" and a text input inside where users insert a YouTube video URL.

When the URL looks like http://... or https://..., after submitting form, I receive error 406. But when it looks like www.youtube..., everything goes OK. I tried <input type="url", but it doesn't help.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Valeriu Mazare
  • 323
  • 5
  • 12

2 Answers2

0

Try using:

<input type="text"

If you need to remove the actual http:// part before submitting the form you'll want to use a regex pattern to remove it (info).

Community
  • 1
  • 1
l'L'l
  • 44,951
  • 10
  • 95
  • 146
0

This worked:

<input type = "text" id = "mytextbox" onkeyup = "striphttp()">
    <script type = "text/javascript">
        function striphttp() {
            var url = document.getElementById("mytextbox").value;
            url = url.replace(/http:\/\/w/gi,"w");
            document.getElementById("mytextbox").value = url;
        }
    </script>
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Valeriu Mazare
  • 323
  • 5
  • 12