-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselectuser.js
92 lines (77 loc) · 1.75 KB
/
selectuser.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
var xmlhttp;
function showUser(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="chkajaxx.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
function eng(){
document.dtfrm.txte.style.visibility='visible';
document.dtfrm.txtn.style.visibility='hidden';
document.dtfrm.txtf.value="eng";
document.dtfrm.txtn.value="";
document.dtfrm.frmSend.value="Convert to Nepali Date";
document.dtfrm.txte.focus();
}
function nep(){
document.dtfrm.txtn.style.visibility='visible';
document.dtfrm.txte.style.visibility='hidden';
document.dtfrm.txtf.value="nep";
document.dtfrm.txte.value="";
document.dtfrm.frmSend.value="Convert to English Date";
document.dtfrm.txtn.focus();
}
function valifrm(){
var t1=document.dtfrm.txte.value;
var t2=document.dtfrm.txtn.value;
theradio=document.dtfrm.radiobutton;
var strr;
if(!theradio[0].checked && !theradio[1].checked)
{
alert('Please select the desired Date Type.')
return false;
}
if(t1=="" && t2==""){
alert ('Please enter the Date in MM/DD/YYYY format.' )
return false;
}
if(theradio[0].checked)
{
strr="eng-" + document.dtfrm.txte.value;
}
else if(theradio[1].checked)
{
strr="nep-" + document.dtfrm.txtn.value;
}
showUser(strr);
}