asp.net jquery - Firefox frontend doesn't work

Viewed 28

i use that code doesn't work at firefox browser it is work in chrome and IE i do all of what i can

jquery chrome also works. But firefox is not working. I did not understand the reason. Sometimes I have this problem. Firefox also needs to be written differently. Help please.





function myTrim(x) {
         return x.replace(/^\s+|\s+$/gm, "");
        }

    $("#btnUpdateProfile").on("click", function () {
        var IsValid = true;
        debugger;
            if ($("#rbFileName").is(":checked")) {
                   if ($("#tbTelephone").length > 0 && myTrim($("#tbTelephone").val()) != "" && myTrim($(".txtUploadPath").val()) != "") {
                    var LastFiveTelephoneDigit = myTrim($("#tbTelephone").val()).slice($("#tbTelephone").val().length - 5);
                    if (!$(".txtUploadPath").val().includes(LastFiveTelephoneDigit)) {
                        alert('@Resources.Survey.alertSubmit');
                        IsValid = false;
                    }
                }
            }
        if (IsValid) {
            if (CustomerInfoValidation()) {
                SaveCustomerInfo();
            }
            else {
                UpdateProgress.Hide();
                ShowMessage('DivError',' @Resources.Survey.NotFillData');
            }
        }
        return false;
    });

i use that code doesn't work at firefox browser it is work in chrome and IE i do all of what i can

jquery chrome also works. But firefox is not working. I did not understand the reason. Sometimes I have this problem. Firefox also needs to be written differently. Help please.

 function SaveCustomerInfo() {
            debugger;
              $(".loading").css("display", "block");
        var objNewReq = new Object();
        objNewReq.CompanyCode = companyCode;
        objNewReq.RequestID =requestID;
       objNewReq.UserCode = userCode;
       objNewReq.AccountNumber = CSProfile.AccountNumber;
        if ($("#tbFirstName").val() != undefined)
            objNewReq.FirstName = $("#tbFirstName").val();
        if ($("#tbLastName").val() != undefined)
            objNewReq.LastName = $("#tbLastName").val();
        if ($("#tbEmail").val() != undefined)
            objNewReq.Email = $("#tbEmail").val();
        if ($("#tbTelephone").val() != undefined)
            objNewReq.Telephone = $("#tbTelephone").val();
              if ($("#tbContactStoreFax").val() != undefined)
                  objNewReq.Fax = $("#tbContactStoreFax").val();
              if ($("#tbContactStorePOBox").val() != undefined)
                  objNewReq.PostalCode = $("#tbContactStorePOBox").val();
              if ($("#tbContactStoreAddress").val() != undefined)
                  objNewReq.Address1 = $("#tbContactStoreAddress").val();
              ($("#tbContactStoreAddress2").val() != undefined)
              objNewReq.Address2 = $("#tbContactStoreAddress2").val();
        if ($("#tbTelephone2").val() != undefined)
            objNewReq.Mobile = $("#tbTelephone2").val();
        if ($("#tbFollowupon").val() != undefined)
            objNewReq.FollowupDate = $("#tbFollowupon").val();
        if ($("#tbFollowupNote").val() != undefined)
            objNewReq.FollowupMessage = $("#tbFollowupNote").val();
        if ($("#ddlstLanguage").val() != undefined)
            objNewReq.LanguageCode = $("#ddlstLanguage").val();
        if ($("#ddlstGender").val() != undefined)
            objNewReq.GenderCode = $("#ddlstGender").val();
        //if ($("#ddlInfoSalutation").val() != undefined)
            objNewReq.SalutationCode = $("#ddlInfoSalutation").val();

        var lstFields = [];
              $("[id^='ddlReqItem_']").each(function () {
                  var checked = $("input[name='" + $(this)[0].id + "']").filter(":checked");
                  if ($(checked).length>0 ) {
                      lstFields.push({
                          FieldID: $(checked)[0].value,
                          FieldValue: $(checked).attr("attr-value"),
                          FieldName: $(this).attr("attr-FieldName") + "_L1_"
                      })

                  }

        });

        $("[id^='tbAttrValue']").each(function () {
            lstFields.push({
                FieldID: -1,
                FieldValue: $(this).val(),
                FieldName: $(this)[0].id.replace("tbAttrValue", "")
            })
        });

        objNewReq.lstFields = lstFields;

              var obj = JSON.stringify({ objReq: objNewReq});

              var pagePath = window.location.pathname;
              console.log(obj);
              WSHelper.CallPostJsonService(WSHelper.CallUrl + "/SaveCustomerInfo", obj, Get_SaveCustomerInfo_CallBack, Get_Failure);


        return false;
        }

that is all of my code it is sometimes work and other times it is work. i really don't know what can i do.

0 Answers
Related