aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/functionality/grn-search.ts
blob: 02471f5b318869fa78c2f517ce0f63b8fd1ca1fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$("#frmpaymentDetails > div:nth-child(2) > div:nth-child(1) > div:nth-child(4)").hide();
const captcha = $("#txtDrawText");
const captchaText = $("#captchaText");
captcha.val((captchaText.val() as string).replaceAll(" ", ""));

const requestTypeElement = $("#lstRequestType");
const grnNumberElement = $("#txtGRN_NO");
const applicationNumberElement = $("#txtAPPLN_NO");

const requestType = localStorage.getItem("requestType");
const grnNumber = localStorage.getItem("grnNumber");
const applicationNumber = localStorage.getItem("applicationNumber");

if (requestType) {
	requestTypeElement.val(requestType);
}

if (grnNumber) {
	grnNumberElement.val(grnNumber);
}

if (applicationNumber) {
	applicationNumberElement.val(applicationNumber);
}

$("#btnSubmitGRNNo").click(() => {
	captcha.val((captchaText.val() as string).replaceAll(" ", ""));
	localStorage.setItem("requestType", requestTypeElement.val() as string);
	localStorage.setItem("grnNumber", grnNumberElement.val() as string);
	localStorage.setItem("applicationNumber", applicationNumberElement.val() as string);
});