0

i learning jquery validation from >> http://bassistance.de/jquery-plugins/jquery-plugin-validation/. I set custom message inline html, like this

<input name="pelatihan_performance" type="radio" value="1"  required />
<input name="pelatihan_performance" type="radio" value="2" />
<input name="pelatihan_performance" type="radio" value="3" />
<input name="pelatihan_performance" type="radio" value="4" />
 <input name="pelatihan_performance" type="radio" value="5" />

// error handler
<label for="pelatihan_performance" class="error">Harap pilih Kinerja</label>

but when i run this code, error just display "This field is required" not "Harap pilih Kinerja" . how to fix it ?

1
  • 1
    try <input name="pelatihan_performance" type="radio" value="1" required data-msg-required="Harap pilih Kinerja"/> Commented Sep 1, 2014 at 3:51

2 Answers 2

1

You can pass the custom message using a data-msg- property like

<input name="pelatihan_performance" type="radio" value="1"  required data-msg-required="Harap pilih Kinerja"/>

Demo: Fiddle

Still you want to place the error message in a particular place, you may want to override the errorPlacement option

Sign up to request clarification or add additional context in comments.

Comments

0

You can add custom message by rules

$('#form').validate({
    rules: {
        pelatihan_performance: {
            required : true
        }
    },
    messages: {
        pelatihan_performance: "Harap pilih kinerja"
    }
});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.