Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. following jquery code not working when deployed on servers

following jquery code not working when deployed on servers

Scheduled Pinned Locked Moved The Lounge
javascriptasp-netcsharphtmldocker
19 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 10516938
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • U User 10516938

      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

      P Offline
      P Offline
      phil o
      wrote on last edited by
      #2

      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."

      C Z 2 Replies Last reply
      0
      • P phil o

        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."

        C Offline
        C Offline
        CodeWraith
        wrote on last edited by
        #3

        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.

        D 1 Reply Last reply
        0
        • C CodeWraith

          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.

          D Offline
          D Offline
          DRHuff
          wrote on last edited by
          #4

          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.

          C 1 Reply Last reply
          0
          • D DRHuff

            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.

            C Offline
            C Offline
            CodeWraith
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • P phil o

              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."

              Z Offline
              Z Offline
              ZurdoDev
              wrote on last edited by
              #6

              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.

              P 1 Reply Last reply
              0
              • Z ZurdoDev

                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.

                P Offline
                P Offline
                phil o
                wrote on last edited by
                #7

                So, what do you propose instead?

                "Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."

                Z 1 Reply Last reply
                0
                • P phil o

                  So, what do you propose instead?

                  "Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."

                  Z Offline
                  Z Offline
                  ZurdoDev
                  wrote on last edited by
                  #8

                  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.

                  P 1 Reply Last reply
                  0
                  • Z ZurdoDev

                    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.

                    P Offline
                    P Offline
                    phil o
                    wrote on last edited by
                    #9

                    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."

                    Z 1 Reply Last reply
                    0
                    • P phil o

                      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."

                      Z Offline
                      Z Offline
                      ZurdoDev
                      wrote on last edited by
                      #10

                      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.

                      P 1 Reply Last reply
                      0
                      • Z ZurdoDev

                        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.

                        P Offline
                        P Offline
                        phil o
                        wrote on last edited by
                        #11

                        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."

                        Z 1 Reply Last reply
                        0
                        • P phil o

                          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."

                          Z Offline
                          Z Offline
                          ZurdoDev
                          wrote on last edited by
                          #12

                          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.

                          P H 2 Replies Last reply
                          0
                          • Z ZurdoDev

                            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.

                            P Offline
                            P Offline
                            phil o
                            wrote on last edited by
                            #13

                            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."

                            Z 1 Reply Last reply
                            0
                            • P phil o

                              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."

                              Z Offline
                              Z Offline
                              ZurdoDev
                              wrote on last edited by
                              #14

                              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.

                              P 1 Reply Last reply
                              0
                              • Z ZurdoDev

                                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.

                                P Offline
                                P Offline
                                phil o
                                wrote on last edited by
                                #15

                                I empathize then, must be frustrating :)

                                "Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."

                                Z 1 Reply Last reply
                                0
                                • Z ZurdoDev

                                  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.

                                  H Offline
                                  H Offline
                                  honey the codewitch
                                  wrote on last edited by
                                  #16

                                  I'm not a woman. I'm quite male, just genderweird. And i don't use facebook

                                  Real programmers use butterflies

                                  Z 1 Reply Last reply
                                  0
                                  • P phil o

                                    I empathize then, must be frustrating :)

                                    "Five fruits and vegetables a day? What a joke! Personally, after the third watermelon, I'm full."

                                    Z Offline
                                    Z Offline
                                    ZurdoDev
                                    wrote on last edited by
                                    #17

                                    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.

                                    1 Reply Last reply
                                    0
                                    • H honey the codewitch

                                      I'm not a woman. I'm quite male, just genderweird. And i don't use facebook

                                      Real programmers use butterflies

                                      Z Offline
                                      Z Offline
                                      ZurdoDev
                                      wrote on last edited by
                                      #18

                                      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.

                                      H 1 Reply Last reply
                                      0
                                      • Z ZurdoDev

                                        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.

                                        H Offline
                                        H Offline
                                        honey the codewitch
                                        wrote on last edited by
                                        #19

                                        Nope, I've told others the same thing I've told you. =)

                                        Real programmers use butterflies

                                        1 Reply Last reply
                                        0
                                        Reply
                                        • Reply as topic
                                        Log in to reply
                                        • Oldest to Newest
                                        • Newest to Oldest
                                        • Most Votes


                                        • Login

                                        • Don't have an account? Register

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • World
                                        • Users
                                        • Groups