0

Hello i have an osclass website, i made some custom fields required with this code

<script type="text/javascript">
        $("#countryId").attr('required', 'required');
        $("#regionId").attr('required', 'required');
        $("#city").attr('required', 'required');
        $("#cityArea").attr('required', 'required');
        $("#contactName").attr('required', 'required');
        $("#price").attr('required', 'required');
</script>

please help me to change the default message to : "please fill out this field"

Thank you very much

rolleer
  • 3
  • 2
  • 1
    Possible duplicate of http://stackoverflow.com/questions/25628209/dynamically-change-required-for-html5-input-control – arthurakay Feb 29 '16 at 12:52
  • 2
    Possible duplicate of [Set custom HTML5 required field validation message](http://stackoverflow.com/questions/13798313/set-custom-html5-required-field-validation-message) – PeeHaa Feb 29 '16 at 12:55

1 Answers1

0

I think this will be helpful <input type="text" required title="Custom message" />

  • just add the title attribute to the input element –  Feb 29 '16 at 13:36
  • well you can use it through jQuery like this –  Feb 29 '16 at 13:53
  • $('#countryId'). attr("title", "Custom message"); –  Feb 29 '16 at 13:54
  • can you show all of your code and please do not type it in comments instead edit the question and type code –  Feb 29 '16 at 15:27
  • hello, 'm sorry but i'm new here. I have deleted my comments and i included the link with full code in my question. Thanks – rolleer Feb 29 '16 at 16:14