How to disable the default HTML input box message?
P粉919464207
P粉919464207 2023-08-01 19:03:54
0
1
543
<p>When I press the submit button of an empty html input textbox, this default message appears automatically. I want the border of the box to be red instead of this default message. How do I do that?<br /><br />Here is the code for the box:</p><p><br /></p> <pre class="brush:php;toolbar:false;"><div class="input-group" id="email-input"> <input type="text" id="email" name="email" autocomplete="off" required placeholder="Email"> </div></pre>
P粉919464207
P粉919464207

reply all(1)
P粉592085423
  1. Remove the required attributes from the HTML <input> tag.

Remove the displayed "Please fill in this field" prompt.

For the red border, you may consider doing this:


  1. Use CSS pseudo-classes (eg: hover) to enable interactive animations


.input-group:hover, .input-group:focus-within {
  border-block-color: red;
  box-shadow: 0px 0px 3px 2px red;
  box-sizing: border-box;
  display: inline-block;
}
<div class="input-group" id="email-input">
  <input type="text" id="email" name="email" autocomplete="off" placeholder="Email">
</div>


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!