SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a survey with rating questions and branch logic and most are required fields. Any suggestions/ideas on how to use Javascript/JQuery to change the OOTB required field user message "You must specify a value for this required field" ?

Thanks in advance

share|improve this question
can you share some bits of the html source around the field validator? – Tiago Duarte Jul 31 '14 at 21:15

this will be attached specifically to surveys and you can tweak both types of messages

<script type="text/javascript">
$(document).ready(function () {

        //override: "You must specify a value for this required field."

        //per-field validator
        $('.ms-formbodysurvey .ms-formvalidation > span[role="alert"]').text("Please specify a value for this field.");

        //summary validator
        $('.ms-formbodysurvey[role="alert"]').text("Please make sure all required fields are properly filled.");

share|improve this answer
Thanks, that helpered alot. – rhonda Aug 25 '14 at 15:20

You can use this code. You should add this to both NewForm.aspx and EditForm.aspx.

<script type="text/javascript">

var alertSpan= $('span[role="alert"]');
alertSpan.text('My Custom Alert!');

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.