PageSourceSearch

https://www.sebi.gov.in/sebiweb/js/udincheck_v2.js

js sebi.gov.in collected 2026-09-24 08:38:05 UTC 11,431 bytes, 343 lines download raw bytes

1function checkUdin()
2{
3    if (document.homeForm.documentNo.value == "")
4    {
5        alert("Please enter Document no.");
6        document.homeForm.documentNo.focus();
7        return false;
8    }
9    if (document.homeForm.senderName.value == "")
10    {
11        alert("Please enter Sender's Name");
12        document.homeForm.senderName.focus();
13        return false;
14    }
15    if (document.homeForm.dateofissue.value == "")
16    {
17        alert("Please enter Date of Issue");
18        document.homeForm.dateofissue.focus();
19        return false;
20    }
21    if (document.homeForm.recipient_name.value == "")
22    {
23        alert("Please enter Recipient Name");
24        document.homeForm.recipient_name.focus();
25        return false;
26    }
27    return true;
28}
29
30function checkOTP()
31{
32    if (document.homeForm.verifier_name.value == "")
33    {
34        alert("Please enter Verifier name");
35        document.homeForm.verifier_name.focus();
36        return false;
37    }
38    if (document.homeForm.relation.value == "")
39    {
40        alert("Please enter Relation with recipient");
41        document.homeForm.relation.focus();
42        return false;
43    }
44    if (document.homeForm.mobileNo.value == "")
45    {
46        alert("Please enter mobile number.");
47        document.homeForm.mobileNo.focus();
48        return false;
49    }
50    var regex = new RegExp('^\\d{10}$');
51    if (!regex.test(document.homeForm.mobileNo.value))
52    {
53        alert("Please enter 10 digit mobile number. Do not use any prefix i.e. 0,+91 etc.");
54        document.homeForm.mobileNo.focus();
55        return false;
56    }
57    if(removeSpaces(document.forms[0].cap_result.value) == "")
58    {
59        alert("Please enter captcha.");
60        document.forms[0].cap_result.focus();
61        return false;
62    }
63    if(removeSpaces(document.getElementById('txtCaptcha_result').value) != removeSpaces(document.forms[0].cap_result.value))
64    {
65        alert("Captcha does not match.");
66        DrawCaptchaResult();
67        document.forms[0].cap_result.value = "";
68        document.forms[0].cap_result.focus();
69        return false;
70    }
71    return true;
72}
73
74function checkOTPDetails()
75{
76    if ($('#userAuthId').val() == "")
77    {
78        alert("Please enter user details and request otp again !!");
79        document.homeForm.verifier_name.focus();
80        return false;
81    }
82    if (document.homeForm.otpNo.value == "")
83    {
84        alert("Please enter otp");
85        document.homeForm.relation.focus();
86        return false;
87    }
88    return true;
89}
90
91function getCookie(cname) {
92  let name = cname + "=";
93  let decodedCookie = decodeURIComponent(document.cookie);
94  let ca = decodedCookie.split(';');
95  for(let i = 0; i <ca.length; i++) {
96    let c = ca[i];
97    while (c.charAt(0) == ' ') {
98      c = c.substring(1);
99    }
100    if (c.indexOf(name) == 0) {
101      return c.substring(name.length, c.length);
102    }
103  }
104  return "";
105}
106
107function countdown(){
108    var cookieExpiry = getCookie("dnvsAuthToken");
109    if(cookieExpiry == ""){
110        $('#userAuthId').val('');
111        document.getElementById('countdown-timer').innerHTML = "Re-authentication Required. &nbsp; <button onClick='window.location.reload();'>Refresh Page</button>";        
112    }
113    
114    var expiryDate = new Date((new Date()).getTime() + 5 * 60000).getTime();
115    var minutes;
116    var seconds;
117    
118    let x = setInterval(function () {
119        let now = new Date().getTime();
120        let timeRemaining = expiryDate - now;
121        minutes = Math.floor(timeRemaining / 60000);
122        seconds = Math.floor((timeRemaining % 60000) / 1000);
123
124        document.getElementById('countdown-timer').innerHTML = "Time Remaining : " +
125            minutes + "min " + seconds + "sec ";
126    
127        //console.log(minutes + ", " + seconds);
128
129        if (timeRemaining < 0) {
130            clearInterval(x);
131            document.getElementById("countdown-timer")
132                    .innerHTML = "<a href='#' onclick='location.reload()'>Re-authentication Required ... Click here</a>";
133            $('#submitudin').prop("href","javascript: alert('Re-authentication Required');"); 
134        }
135        
136    }, 1000);
137}
138
139function submitOtp()
140{    
141    if(checkOTPDetails())
142    {
143        var userAuthId = $('#userAuthId').val();
144        var otpNo = document.homeForm.otpNo.value;
145        var url = "/sebiweb/ajax/other/otp_validation.jsp";
146        var httpinst = getHTTPObject();
147        var getstr = "userAuthId="+escape(userAuthId);
148        getstr += "&otpNo="+escape(otpNo);
149        httpinst.open("POST", url, true);
150        httpinst.onreadystatechange = function()
151        {
152            if (httpinst.readyState == 4)
153            {
154                if(httpinst.status == 200)
155                {
156                    var response = httpinst.responseText;
157                    var arr = response.split("##$##");
158                    DrawCaptchaResult();
159                    
160                    if(parseInt(arr[1]) == 1){
161                        document.getElementById("ajax_div").innerHTML=arr[0];
162                        HideDiv0();
163                        HideDiv1();
164                        ShowDiv2();
165                        countdown();
166                    }else{
167                        document.getElementById("ajax_div0").innerHTML=arr[0];
168                        HideDiv1();
169                        $('#userAuthId').val('');
170                    }
171                }
172            }
173        };
174        httpinst.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
175        httpinst.send(getstr);
176    }
177}
178
179function submitUdin()
180{
181    $('#ajax_div2').hide();
182    if(checkUdin())
183    {
184        var documentNo = document.homeForm.documentNo.value;
185	var dateofissue = document.homeForm.dateofissue.value;
186        var senderName = document.homeForm.senderName.value;
187        var recipient_name = document.homeForm.recipient_name.value;
188        var subject = document.homeForm.subject.value.replace(/\s+/g, '');
189        var url = "/sebiweb/ajax/other/udin_verification_v2.jsp";
190        var httpinst = getHTTPObject();
191        var getstr = "documentNo="+escape(documentNo);
192        getstr += "&senderName="+escape(senderName);
193        getstr += "&dateofissue="+escape(dateofissue);
194        getstr += "&recipient_name="+escape(recipient_name);
195        getstr += "&subject="+escape(subject);
196        httpinst.open("POST", url, true);
197        httpinst.onreadystatechange = function()
198        {
199            if (httpinst.readyState == 4)
200            {
201                if(httpinst.status == 200)
202                {
203                    var response = httpinst.responseText;
204                    var arr = response.split('##$##');
205                    //document.getElementById("ajax_div2").innerHTML=response;
206                    document.getElementById("ajax_div2").innerHTML=arr[0];
207                    $('#ajax_div2').show();
208                    if(arr.length == 2){
209                        if(parseInt(arr[1]) == 1){
210                            $('#submitudin').prop("href","javascript: alert('" + "Too many failed attempts. You are requested to retry after 24 hours." + "');"); 
211                        }else if(parseInt(arr[1]) == 2){
212                            $('#submitudin').prop("href","javascript: alert('" + "Account permanently locked." + "');"); 
213                        }
214                    }
215                    DrawCaptchaResult();
216                }
217            }
218        };
219        httpinst.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
220        httpinst.send(getstr);
221    }
222}
223
224function resetUdin()
225{
226    location.reload();
227//    document.homeForm.reset();
228//    document.getElementById("ajax_div").innerHTML = "";
229//    document.homeForm.documentNo.value = "";
230//    document.homeForm.senderName.value = "";
231//    document.homeForm.dateofissue.value = "";
232//    document.homeForm.mobileNo.value = "";
233//    
234//    DrawCaptchaResult();
235}
236
237function DrawCaptchaResult()
238{
239    if(document.getElementById("txtCaptcha_result"))
240    {
241        setcaptchasession("7");	
242	document.forms[0].cap_result.value = "";
243    }
244}
245
246function numberValidation() 
247{
248    event.preventDefault();
249    var n = document.getElementById("mobileNo").value;
250    if (isNaN(n)) 
251    {
252        alert("Please enter Numeric value.");
253        document.homeForm.mobileNo.focus();
254        return false;
255    }
256    return true;
257}
258
259function sendOTP() 
260{
261    if(checkOTP())
262    {
263        document.getElementById("ajax_div0").innerHTML = "";
264        document.getElementById("ajax_div").innerHTML = "";
265        document.getElementById("ajax_div2").innerHTML = "";
266        var mobileNo = document.forms[0].mobileNo.value;
267        var verifierName = document.forms[0].verifier_name.value;
268        var relation = document.forms[0].relation.value;
269//        alert("test");
270        var url = "/sebiweb/ajax/other/udin_otp_v2.jsp";
271        var httpinst = getHTTPObject();
272        var getstr = "mobileNo=" + mobileNo;
273        getstr += "&verifierName=" + verifierName;
274        getstr += "&relation=" + relation;
275//        getstr += "&email="+escape(emailid);
276        console.log("getString "+getstr);
277        getstr += "&cap_reg="+escape(document.forms[0].cap_result.value);
278        httpinst.open("POST", url, true);
279        httpinst.onreadystatechange = function()
280        {
281            if (httpinst.readyState == 4)
282            {
283                if(httpinst.status == 200)
284                {
285                    var response = httpinst.responseText;
286                    var arr = response.split("##$##");
287                    document.getElementById("ajax_div_otp").style.display = "block";
288                    document.getElementById("ajax_div_otp").innerHTML=arr[0];
289                    if(arr[1] != undefined && arr[1] != ""){
290                        $('#userAuthId').val(parseInt(arr[1]));
291                        //setTimeout(function(){document.getElementById("ajax_div_otp").style.display = "none";}, 9000);
292                        DrawCaptchaResult();
293                        ShowDiv1();
294                    }
295                }
296                else
297                {
298                   HideDiv1(); 
299                }
300            }
301        };
302        httpinst.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
303        httpinst.send(getstr);
304        DisableField1();
305    }
306}
307
308//hide and show function
309function ShowDiv0()
310{
311    document.getElementById('div0').style.display ='block';
312}
313function HideDiv0()
314{
315    document.getElementById('div0').style.display ='none';
316}
317function ShowDiv1()
318{
319    document.getElementById('div1').style.display ='block';
320}
321function HideDiv1()
322{
323    document.getElementById('div1').style.display ='none';
324}
325function ShowDiv2()
326{
327    document.getElementById('div2').style.display ='block';
328}
329function HideDiv2()
330{
331    document.getElementById('div2').style.display ='none';
332}
333function HideDivOtp()
334{
335    document.getElementById('ajax_div_otp').style.display ='none';
336}
337
338function DisableField1()
339{
340    document.homeForm.verifier_name.readOnly =true;
341    document.homeForm.relation.readOnly =true;
342    document.homeForm.mobileNo.readOnly =true;
343}

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.