Horje

How to add HTML <input> pattern characters http:// or https://

An <input> element with type="url" that must start with http:// or https:// followed by at least one character.

If you enter the characters: jahddd then you will get warning: characters Please Enter a URL.

index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The input pattern attribute</h1>

<p>A form with a URL field that must start with http:// or https:// followed by at least one character:</p>

<form action="/action_page.php">
  <label for="website">Homepage:</label>
  <input type="url" id="website" name="website" pattern="https?://.+" title="Include http://">
  <input type="submit">
</form>

</body>
</html>

Output should be:

How to add HTML <input> pattern characters http:// or https://




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin