Where does this notification "tooltip" come from

Asked

Viewed 308 times

3

I was doing a development of an ASPX page with JQUERY, W3DATA and w3CSS, and when I made a Submit of my form, the following popup appeared:

inserir a descrição da imagem aqui

All form fields contain the "required" key, but I have not specified anywhere to start the validation.

Where does this notification come from? Is it possible to control? If so, how?

  • 1

    I think it’s from every browser, it comes from HTML5, every browser has its own style, I could be wrong.

  • If you do not want it to appear just remove the required.

3 answers

3

Are you sure you didn’t specify? This feature is part of HTML5.

The canvas field should be like this:

<input type="text" name="titulo_notificacao" required>

3

You do not need to specify anywhere for HTML5 to validate the form. Containing the required and a Ubmit button in the form, this message will appear.

If the input is type="email"for example, it will ask you to put the email in the right format, with @. Any input that has a pattern, it will show the message asking for the input to be typed in the correct format.

Remembering that this message only appears in Chrome, firefox does not appear (but continues to validate).

-1

This tooltrip is an attribute of html required. Surely your property is with this annotation. Or this property is declared in html.

Example:

[Required(ErrorMessage = "Preencha este campo")]
public string Notificacao{ get; set; }
  • I can’t remember if that’s all it notes required on the field tag. It was good to take a test.

  • Yes, it makes it required, but in your view you have to add Validationmessagefor from Razor. @Html.Validationmessagefor(model => model.Notification)

  • I took a test here and it stays like this: <input class="form-control text-box single-line" data-val="true" data-val-number="Preencha este campo" data-val-required="Preencha este campo" id="Preco" name="Preco" type="text" value="">. It’s not the same.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.