lundi 23 janvier 2023

HTML input pattern doesn'n work correctly

I have a form

<form method="POST">
    <p><label for="id_product_phone">Phone number:</label>
        <input type="text" pattern="\+?[0-9\s\-\(\)]+" title="Invalid phone number" name="product_phone" maxlength="20" required="" id="id_product_phone"></p>
    <p><label for="id_product_productname">Product name:</label>
        <input type="text" pattern="[A-Za-z]" name="product_productname" maxlength="100" required="" id="id_product_productname"></p>
    <p><label for="id_product_description">Description:</label>
        <input type="text" name="product_description" maxlength="500" id="id_product_description"></p>
    <p><label for="id_product_media">Picture:</label>
        <input type="file" name="product_media" required="" id="id_product_media"></p>
    <button type="submit">Надіслати</button>
</form>

and when i try to submit it's all, second input say it's not correct data in this field, but i write only letters what i set. Why it doesn't work? Can someone check and they me, please

I use Firefox.

Aucun commentaire:

Enregistrer un commentaire