I am already using script below for that but can override !important in CSS
<script>
var forms = document.getElementsByTagName('form');
for (var i = 0; i < forms.length; i++) {
forms[i].noValidate = true;
forms[i].addEventListener('submit', function(event) {
//Prevent submission if checkValidity on the form returns false.
if (!event.target.checkValidity()) {
event.preventDefault();
//Implement you own means of displaying error messages to the user here.
document.getElementById("first_name").style.border ="1px solid red";
}
}, false);
}
</script>
<form action="" method="post" target="_top">
<input type="text" name="first_name" id="first_name" value="" style="width:100px;height: 25px !important;" placeholder="Name" required >
</form>
and why i want border color when submit button clicked if no value set in input field because safari does not support required attribute.......... If any one can help pls help me out either overriding border attribute solution or alternative solution for required attribute which can work on safari browser too.
NOTE:- No use of JQuery in any way....