PageSourceSearch

https://ramkumarsarraf.in/js/GetQuote.js

js ramkumarsarraf.in collected 2026-10-04 06:52:08 UTC 7,040 bytes, 203 lines download raw bytes

1$(document).ready(function () {
2    //$("#GetQuoteResponsePopUp").modal('show');
3    //$('#GetQuoteResponsePopUp').find('#GetQuoteResponsePopUpMessage').html("Thanks for contacting us! <br/>  We will be in touch with you shortly.");
4    $(document).on("click",".GetQuoteForm",function()
5    {
6        
7        $("#btnsubmit_GetQuote").attr("productname", "");
8        $("#btnsubmit_GetQuote").attr("productid", "");
9        $("#btnsubmit_GetQuote").attr("productlogo", "");
10        $("#btnsubmit_GetQuote").attr("ProductUrl", "");
11        $('#ImgGetQuoteLogo').attr("src", "");
12
13        $('#txtGetQuotemobileerormsg').hide();
14        $('#txtGetQuoteemailiderrormsg').hide();
15        $('#txtGetQuotenameerrormsg').hide();
16
17        $("#GetQuotePopUp").modal("show");
18        var productname = $(this).attr("productname");
19        var productid = $(this).attr("productid");
20        var productlogo = $(this).attr("productlogo");
21        var ProductUrl = window.location.href;
22
23        $('#ImgGetQuoteLogo').attr("src",productlogo);
24        $("#btnsubmit_GetQuote").attr("productname", productname);
25        $("#btnsubmit_GetQuote").attr("productid", productid);
26        $("#btnsubmit_GetQuote").attr("productlogo", productlogo);
27        $("#btnsubmit_GetQuote").attr("ProductUrl", ProductUrl);
28    })
29
30
31    $(document).on("click", "#btnsubmit_GetQuote", function () {
32        var validate = "0";
33        
34
35        var _ProductName = $("#btnsubmit_GetQuote").attr("productname");
36        var _ProductId = $("#btnsubmit_GetQuote").attr("productid");
37        var _productlogo = $("#btnsubmit_GetQuote").attr("productlogo");
38        var _ProductUrl = $("#btnsubmit_GetQuote").attr("ProductUrl");
39        var _GetQuoteName = $('#txtGetQuoteName').val();
40        var _GetQuoteMobile = $('#txtGetQuoteMobile').val();
41        var _GetQuoteEmail = $('#txtGetQuoteEmail').val();
42    
43        if (_GetQuoteMobile.trim() == "") {
44            $('#txtGetQuotemobileerormsg').show();
45            $('#txtGetQuotemobileerormsg').html("Please enter mobile no");
46
47            validate = 1;
48        }
49        else if (_GetQuoteMobile.length<10) {
50            $('#txtGetQuotemobileerormsg').show();
51            $('#txtGetQuotemobileerormsg').html("Please enter valid mobile no");
52
53            validate = 1;
54        }
55        else {
56            if (!mobilevalid(_GetQuoteMobile, "txtGetQuoteMobile")) {
57                validate = 1;
58                $('#txtGetQuotemobileerormsg').show();
59            }
60            else {
61                $('#txtGetQuotemobileerormsg').hide();
62            }
63        }
64
65        //if (_GetQuoteEmail == "") {
66        //    $('#txtGetQuoteemailiderrormsg').show();
67        //    $('#txtGetQuoteemailiderrormsg').html("Please enter email id");
68        //    validate = 1;
69        //    $('#txtGetQuoteEmail').focus();
70        //}
71        //else {
72            if (_GetQuoteEmail != "") {
73                if (!validateEmail(_GetQuoteEmail, "txtGetQuoteemailiderrormsg", "txtGetQuoteEmail")) {
74                    $('#txtGetQuoteemailiderrormsg').html("Please enter valid email id");
75                    validate = 1;
76                }
77                else {
78                    $('#txtGetQuoteemailiderrormsg').hide();
79                }
80            }
81
82        //}
83
84
85        //------firstname-----
86        if (_GetQuoteName == "") {
87            $('#txtGetQuotenameerrormsg').show();
88            validate = 1;
89            $('#txtGetQuoteName').focus();
90        }
91        else {
92
93            $('#txtGetQuotenameerrormsg').hide();
94
95        }
96
97    
98
99    
100
101        if (validate == 0) {
102
103            
104
105            $.ajax({
106                type: "POST",
107                url: "/Home/SaveGetQuote",
108                data: { GetQuoteName: _GetQuoteName, GetQuoteMobile: _GetQuoteMobile, GetQuoteEmail: _GetQuoteEmail, ProductId: _ProductId, OtherDescription: _ProductName, LogoPath: _productlogo,ProductUrl:_ProductUrl },
109                beforeSend: function () {
110
111                    $('#btnsubmit_GetQuote').prop("disabled", true);
112                    $('#btnsubmit_GetQuote').html('<i class="fa fa-spinner fa-spin"></i> please wait...');
113
114                },
115                complete: function () {
116                    $('#btnsubmit_GetQuote').prop("disabled", false);
117                    $('#btnsubmit_GetQuote').html('Submit');
118                    
119                },
120                async: true,
121
122                success: function (reponse) {
123                    //console.log(reponse);
124
125
126                    if (reponse == "1") {
127                        
128
129                        $('#GetQuotePopUp').modal('hide');
130                        $('#GetQuoteResponsePopUp').modal('show');
131                        $('#GetQuoteResponsePopUp').find('#GetQuoteResponsePopUpMessage').html("Thanks for contacting us! <br/>  We will be in touch with you shortly.");
132                        
133                        $('#txtGetQuoteName').val("");
134                        $('#txtGetQuoteMobile').val("");
135                        $('#txtGetQuoteEmail').val("");
136                        $('#ImgGetQuoteLogo').attr("src", "");
137                        $("#btnsubmit_GetQuote").attr("productname", "");
138                        $("#btnsubmit_GetQuote").attr("productid", "");
139                        $("#btnsubmit_GetQuote").attr("productlogo", "");
140                        $("#btnsubmit_GetQuote").attr("ProductUrl", "");
141
142                        
143
144                    }
145                    else {
146                        $('#GetQuoteResponsePopUp').modal('show');
147                        $('#GetQuoteResponsePopUp').find('#GetQuoteResponsePopUpMessage').html("Something went wrong. Please try again");
148                        $('#btnsubmit_GetQuote').html("Submit");
149                        $('#btnsubmit_GetQuote').removeAttr("disabled");
150                    }
151                    
152
153
154                },
155                error: function (reponse) {
156                    $(this).prop("disabled", false);
157                },
158                failure: function (reponse) {
159                    $(this).prop("disabled", false);
160                },
161            });
162
163
164        }
165        else
166        {
167            $('#btnsubmit_GetQuote').html("Submit");
168                $('#btnsubmit_GetQuote').removeAttr("disabled");
169        }
170        //else {
171        //    $('#btnsubmit').html("Submit");
172        //    $('#btnsubmit').prop('disabled', false);
173        //}
174    })
175})
176
177$(document).on("keyup", ".onlyalphawithspace", function () {
178
179    this.value = this.value.replace(/[^a-zA-Z\s]+$/, '');
180
181
182});
183
184$(document).on("keyup", ".checkQuote", function () {
185    if (this.value.match(/[']/g)) {
186        this.value = this.value.replace(/[']/g, '');
187    }
188
189});
190
191$(document).on("keyup", ".onlynumeric", function () {
192
193    this.value = this.value.replace(/[^0-9]/g, '');
194
195
196});
197
198
199
200
201
202
203

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.