following jquery code not working when deployed on servers
-
There are different sections on the page(ASP.net MVC) with same controls(ex:phone,email). I want the following validation message to be displayed differently in Validation Summary(with section name) and beside individual text boxes(w/o section name)
This is the validation message specified in the model
[Required(ErrorMessage = "Chief Executive - |Name is required")]
[Required(ErrorMessage = "Medical Director - |Name is required")]The code to replace the '|' symbol in jquery.validate.unobtrusive.js is
function onError(error, inputElement) { // 'this' is the form element
var container = $(this).find(".name) +
"']"),
replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;container.removeClass("field-validation-valid").addClass("field-validation-error");
error.data("unobtrusiveContainer", container);if (replace) {
container.empty();
error.removeClass("input-validation-error").appendTo(container);
}
else {
error.hide();
}error.text(error.text().substr(error.text().indexOf("|") + 1));
}function onErrors(event, validator) { // 'this' is the form element
var container = $(this).find(""),
list = container.find("ul");if (list && list.length && validator.errorList.length) {
list.empty();
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");$.each(validator.errorList, function () {
$("").html(this.message.replace('|', '')).appendTo(list);
});
}
}The pipe symbol is replaced with space and displayed as desired in local host. But when the code is deployed to servers, I am getting the same validation message(with section names) displayed in both validation summary and beside the text boxes also.
I am ready to provide other code also.
I also have this in web.config
-
There are different sections on the page(ASP.net MVC) with same controls(ex:phone,email). I want the following validation message to be displayed differently in Validation Summary(with section name) and beside individual text boxes(w/o section name)
This is the validation message specified in the model
[Required(ErrorMessage = "Chief Executive - |Name is required")]
[Required(ErrorMessage = "Medical Director - |Name is required")]The code to replace the '|' symbol in jquery.validate.unobtrusive.js is
function onError(error, inputElement) { // 'this' is the form element
var container = $(this).find(".name) +
"']"),
replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;container.removeClass("field-validation-valid").addClass("field-validation-error");
error.data("unobtrusiveContainer", container);if (replace) {
container.empty();
error.removeClass("input-validation-error").appendTo(container);
}
else {
error.hide();
}error.text(error.text().substr(error.text().indexOf("|") + 1));
}function onErrors(event, validator) { // 'this' is the form element
var container = $(this).find(""),
list = container.find("ul");if (list && list.length && validator.errorList.length) {
list.empty();
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");$.each(validator.errorList, function () {
$("").html(this.message.replace('|', '')).appendTo(list);
});
}
}The pipe symbol is replaced with space and displayed as desired in local host. But when the code is deployed to servers, I am getting the same validation message(with section names) displayed in both validation summary and beside the text boxes also.
I am ready to provide other code also.
I also have this in web.config
-
Wrong place for your question. Please try Quick Answers[^] instead.
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
And i just wanted to ask a question about how to toast an EPROM. It's a hardware question, so it's allowed here, right? Ahhh, it's too late. Looks like my museum notebook is almost done with toasting. :-)
I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
-
And i just wanted to ask a question about how to toast an EPROM. It's a hardware question, so it's allowed here, right? Ahhh, it's too late. Looks like my museum notebook is almost done with toasting. :-)
I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
-
CodeWraith wrote:
toast an EPROM
Bah - that's too easy. Now - toasting WITH an EPROM - that takes control... :-D
I, for one, like Roman Numerals.
No. That would be all too easy to do if I accidentally jumpered the wrong VPP (the voltage for the programming pulse).
I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
-
Wrong place for your question. Please try Quick Answers[^] instead.
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
phil.o wrote:
Wrong place for your question
Only because they are not a regular, The Lounge[^] :doh:
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
phil.o wrote:
Wrong place for your question
Only because they are not a regular, The Lounge[^] :doh:
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
So, what do you propose instead?
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
-
phil.o wrote:
what do you propose instead?
Consistency.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
Well in this case I invite you to communicate directly with either the moderation team, so that this kind of post is finally authorized in the Lounge, or to @code-witch if you think he is abusing the forum. In my opinion, he is not; he is not asking us to help solve/understand a development issue. This is more a conversation a team of developpers would have around a cup of coffee during their pause, imho.
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
-
Well in this case I invite you to communicate directly with either the moderation team, so that this kind of post is finally authorized in the Lounge, or to @code-witch if you think he is abusing the forum. In my opinion, he is not; he is not asking us to help solve/understand a development issue. This is more a conversation a team of developpers would have around a cup of coffee during their pause, imho.
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
Don't take it personal. I don't care either way, I just wish people would be consistent.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
Don't take it personal. I don't care either way, I just wish people would be consistent.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
I trust people, at least most of them on this forum, to be as consistent as possible. I just don't think both questions are in the same category. I'm not taking it personally; since this is not the first time you do this remark and it seems to annoy you, why not opening a discussion about that in the appropriate forum? It could enact a better formulation of what is allowed and what is not on the Lounge. And if you really don't care, then let it go :)
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
-
I trust people, at least most of them on this forum, to be as consistent as possible. I just don't think both questions are in the same category. I'm not taking it personally; since this is not the first time you do this remark and it seems to annoy you, why not opening a discussion about that in the appropriate forum? It could enact a better formulation of what is allowed and what is not on the Lounge. And if you really don't care, then let it go :)
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
phil.o wrote:
I just don't think both questions are in the same category.
In this case you may be right. However, I have often seen newcomers post questions similar to code-witch (who is a woman by the way) and they get told off by frequent Loungers. But then have no problem having code-witch's facebook feed dump right into CP.
phil.o wrote:
And if you really don't care, then let it go
I think you misunderstood what I don't care about. I DO care that CP is clickish. Why? I don't know. It's just annoying. People annoy me. I should have been born a deer. Let's hope for reincarnation. :laugh: And each time I have brought it up I get ignored or argued with, like you here, so bringing it up elsewhere won't do any good.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
phil.o wrote:
I just don't think both questions are in the same category.
In this case you may be right. However, I have often seen newcomers post questions similar to code-witch (who is a woman by the way) and they get told off by frequent Loungers. But then have no problem having code-witch's facebook feed dump right into CP.
phil.o wrote:
And if you really don't care, then let it go
I think you misunderstood what I don't care about. I DO care that CP is clickish. Why? I don't know. It's just annoying. People annoy me. I should have been born a deer. Let's hope for reincarnation. :laugh: And each time I have brought it up I get ignored or argued with, like you here, so bringing it up elsewhere won't do any good.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
You get ignored or argued with. What other option do you expect? :)
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
phil.o wrote:
What other option do you expect?
For people to agree with me, duh. :-D
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
phil.o wrote:
What other option do you expect?
For people to agree with me, duh. :-D
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
phil.o wrote:
I just don't think both questions are in the same category.
In this case you may be right. However, I have often seen newcomers post questions similar to code-witch (who is a woman by the way) and they get told off by frequent Loungers. But then have no problem having code-witch's facebook feed dump right into CP.
phil.o wrote:
And if you really don't care, then let it go
I think you misunderstood what I don't care about. I DO care that CP is clickish. Why? I don't know. It's just annoying. People annoy me. I should have been born a deer. Let's hope for reincarnation. :laugh: And each time I have brought it up I get ignored or argued with, like you here, so bringing it up elsewhere won't do any good.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
I'm not a woman. I'm quite male, just genderweird. And i don't use facebook
Real programmers use butterflies
-
I empathize then, must be frustrating :)
"Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."
phil.o wrote:
must be frustrating
Indeed. The world would be much better if everyone thought like me. :laugh:
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
I'm not a woman. I'm quite male, just genderweird. And i don't use facebook
Real programmers use butterflies
honey the codewitch wrote:
I'm not a woman.
Stop it. I could have sworn I've seen you tell others that you are a woman. However, please do not send pics either way to prove your point. I believe you. I was wrong.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
honey the codewitch wrote:
I'm not a woman.
Stop it. I could have sworn I've seen you tell others that you are a woman. However, please do not send pics either way to prove your point. I believe you. I was wrong.
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
Nope, I've told others the same thing I've told you. =)
Real programmers use butterflies