Skip to content

Commit 133ea62

Browse files
committed
validator
validate forms
1 parent 971aaa2 commit 133ea62

File tree

2 files changed

+88
-11
lines changed

2 files changed

+88
-11
lines changed

template/register.tpl

+20-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,27 @@
2121

2222

2323

24+
<script type="text/javascript">
25+
function checkform() {
26+
27+
var address = document.regform.address.value;
2428
25-
<form method="post">
29+
if (address == "") {
30+
return true;
31+
} else if (address.length <= 15 )
32+
{
33+
alert('Crypto address is not correct ');
34+
return false;
35+
36+
}
37+
if(/^[a-zA-Z0-9- ]*$/.test(address) == false) {
38+
alert('Crypto address is not correct ');
39+
return false;
40+
}
41+
}
42+
43+
</script>
44+
<form method="post" name="regform" onsubmit="return checkform()">
2645
<div class="form-group">
2746
<label>Username</label>
2847
<input name="username" type="text" class="form-control" placeholder="Your Username">

template/withdrawal.tpl

+68-10
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,28 @@
8686

8787

8888

89+
<div style="border:1px solid #ccc;padding:15px;margin-right:50px;" class="col-md-5">
90+
<h3>Withdraw to AsMoney</h3>
8991

90-
<div class="col-md-4 pull-right">
91-
<button type="button" class="btn btn-success btn-block" data-toggle="modal" data-target="#myModal">
92-
Request a {$curency} withdrawal({$cur_min})
93-
</button>
94-
95-
<button type="button" class="btn btn-warning btn-block" data-toggle="modal" data-target="#asmoney">
96-
Request a Asmoney withdrawal({$as_min})
92+
AsMoney is a bitcoin payment processor that allow us to send micropayments<br><br>
93+
94+
Withdrawal any amount without minimum<br> Payment will be proceed instantly <br>
95+
You can transfer your money to any cryptocoin from AsMoney<br>
96+
If you don't have AsMoney account, create a <a href="https://www.asmoney.com/default.aspx" target="a_blank">new one</a><br>
97+
<br><br><br>
98+
99+
<button type="button" class="btn btn-success btn-block" data-toggle="modal" data-target="#asmoney">
100+
Request a AsMoney withdrawal, minimum is ({$as_min})
97101
</button>
98102

103+
</div>
99104

100-
105+
<div class="col-md-5" style="border:1px solid #ccc;padding:15px;">
106+
<h3>Withdraw to coin</h3>You can withdraw balance directly to your crypto address but you need<br><br>your balance should higher than {$cur_min}<br> Payment will be proceed with delay<br><br><br><br><br><br>
107+
108+
<button type="button" class="btn btn-success btn-block" data-toggle="modal" data-target="#myModal">
109+
Request a coin withdrawal, minimum is ({$cur_min})
110+
</button>
101111

102112
</div>
103113
</div>
@@ -113,12 +123,33 @@
113123
</div>
114124
</div>
115125

126+
<script type="text/javascript">
127+
function checkasmoney() {
128+
129+
var amount = document.asmoney.amount.value;
130+
var wallet = document.asmoney.wallet.value;
131+
132+
if (amount <= 0) {
133+
alert('Amount is incorrect');
134+
return false;
116135
136+
}
137+
138+
if (wallet.length <= 1 ) {
139+
alert('Please Enter your AsMoney username');
140+
return false;
141+
}
142+
143+
return true;
144+
145+
}
146+
147+
</script>
117148

118149
<div class="modal fade" id="asmoney" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
119150
<div class="modal-dialog">
120151

121-
<form action="" method="post">
152+
<form action="" method="post" name="asmoney" onsubmit="return checkasmoney()">
122153
<div class="modal-content">
123154
<div class="modal-header">
124155
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
@@ -163,12 +194,39 @@ Your Asmoney account : {$asmoneyexist}
163194

164195

165196

197+
198+
<script type="text/javascript">
199+
function checkcoin() {
200+
201+
var address = document.coin.address.value;
202+
var amount = document.coin.amount.value;
203+
204+
205+
if (amount <= 0) {
206+
alert('Amount is incorrect');
207+
return false;
208+
209+
}
210+
211+
if (address.length <= 15 )
212+
{
213+
alert('Crypto address is not correct ');
214+
return false;
215+
}
216+
217+
if(/^[a-zA-Z0-9- ]*$/.test(address) == false) {
218+
alert('Crypto address is not correct ');
219+
return false;
220+
}
166221
222+
return true;
223+
}
224+
</script>
167225

168226
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
169227
<div class="modal-dialog">
170228

171-
<form action="" method="post">
229+
<form action="" method="post" name="coin" onsubmit="return checkcoin()">
172230
<div class="modal-content">
173231
<div class="modal-header">
174232
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>

0 commit comments

Comments
 (0)