JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<input type="text" value="" /><br/>
<input type="text" value="" /><br/>
<input type="text" value="" /><br/>
<input type="text" value="" /><br/>
<input type="submit" value="submit"> type a space and press Submit
</form>
CSS
.warning{
background-color:#fff5f5;
}
JavaScript
$('form').submit(function(){
return ($(':input[value*=" "]').addClass('warning').length > 0) ? false : true;
});