You need to sign in to do that
Don't have an account?
Sravani SB
How to display error messages using jquery
<script>
$(document).ready(function(){
$('.f').Click(function(){
alert('Happy New Year');
var status1 = $('.b').val();
if(status1=='open') {
alert(status1);
$('.b').text("Status Field Should not be Open");
}
});});
<apex:commandButton value="Save" action="{!save1}" styleClass="f"/>
$(document).ready(function(){
$('.f').Click(function(){
alert('Happy New Year');
var status1 = $('.b').val();
if(status1=='open') {
alert(status1);
$('.b').text("Status Field Should not be Open");
}
});});
<apex:commandButton value="Save" action="{!save1}" styleClass="f"/>
Greetings to you!
Please refer to the below links which might help you further with the above requirement.
https://th3silverlining.com/2010/03/02/visualforce-form-validation-enhanced/
http://sfdcsrini.blogspot.com/2016/04/jquery-validatior.html
http://cloudyworlds.blogspot.com/2015/11/using-jquery-with-slds-for-validation.html
https://salesforce.stackexchange.com/questions/120794/adding-error-message-to-input-text-using-javascript-jquery-in-visualforce
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas