/needmoreinfo
Is the red border by the browser? firefox? do you know what is the CSS for the red border?
input:required {
box-shadow:none;
}
input:invalid {
box-shadow:0 0 3px red;
}
Or some Javascript package?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
<form action="#">
<input type="text" name="text" required>
<button type="submit">Submit</button>
</form>
When the empty input has been submitted, it shows a red border around the textbox. Is there a way to remove styling?
Then you need use javascript. Css does not check if the form is submitted. The closest you can get is something like
input {
box-shadow:none;
border: 0;
outline:none;
}
input:focus:invalid {
box-shadow:none;
border: 2px solid red !important;
outline:none;
}
Please or to participate in this conversation.