Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
smart_core_connect
/
core-connect
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
35b2d996
authored
Jun 05, 2018
by
Teeradone Darunnat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teeradone signup
parent
adc4a768
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
144 deletions
+27
-144
www/src/Template/Users/signup.ctp
+27
-144
No files found.
www/src/Template/Users/signup.ctp
View file @
35b2d996
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('Firstname');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('Firstname');?><em>* </em></label>
<input type="text" name="firstname" id="firstname" value="" placeholder="FIRSTNAME" class="form-control-reg border-bottom-from">
<input type="text" name="firstname" id="firstname" value="" placeholder="FIRSTNAME" class="form-control-reg border-bottom-from
required letters
">
</div>
</div>
</div>
</div>
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('Lastname');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('Lastname');?><em>* </em></label>
<input type="text" name="lastname" id="lastname" value="" placeholder="LASTNAME" class="form-control-reg border-bottom-from">
<input type="text" name="lastname" id="lastname" value="" placeholder="LASTNAME" class="form-control-reg border-bottom-from
required
">
</div>
</div>
</div>
</div>
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('Username');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('Username');?><em>* </em></label>
<input type="text" name="username" id="username" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from
"
>
<input type="text" name="username" id="username" value="" placeholder="USERNAME" class="form-control-reg border-bottom-from
required alphanumeric" minlength=4 maxlength=10
>
</div>
</div>
</div>
</div>
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
<div class="form-group has-feedback bootstrap-iso">
<div class="form-group has-feedback bootstrap-iso">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('Birthdate');?></label>
<label class="label-text-sub"><?php echo __('Birthdate');?></label>
<input type="text" name="birthdate" id="date" placeholder="กรุณาระบุวันเดือนปีเกิด" value="" placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from" readonly>
<input type="text" name="birthdate" id="date" placeholder="กรุณาระบุวันเดือนปีเกิด" value="" placeholder="DD-MM-YYYY" data-date-format="mm/dd/yyyy" class="form-control-reg border-bottom-from
required datepicker
" readonly>
<span class="glyphicon glyphicon-calendar form-control-feedback"></span>
<span class="glyphicon glyphicon-calendar form-control-feedback"></span>
</div>
</div>
</div>
</div>
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('Phone Number (Mobile)');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('Phone Number (Mobile)');?><em>* </em></label>
<input type="text" name="moblie_no" id="moblie_no" onkeypress="check_phone();" value=""
maxlength="10" placeholder="000-000-0000" class="mask form-control-reg border-bottom-from
">
<input type="text" name="moblie_no" id="moblie_no" onkeypress="check_phone();" value=""
placeholder="000-000-0000" class="mask form-control-reg border-bottom-from required digits" minlength=10 maxlength="10
">
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('Email');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('Email');?><em>* </em></label>
<input type="text" name="email" id="fremail" value="" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from">
<input type="text" name="email" id="fremail" value="" placeholder="mail@xxx.com" class="form-control-reg border-bottom-from
required email small_letters
">
</div>
</div>
</div>
</div>
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('Password');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('Password');?><em>* </em></label>
<input data-toggle="password" data-placement="before" type="password" name="password" id="password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from
" style="padding:0px 0px !important;"
>
<input data-toggle="password" data-placement="before" type="password" name="password" id="password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from
required" style="padding:0px 0px !important;" minlength=8
>
<!--<input type="password" name="data[password]" id="password" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>-->
<!--<input type="password" name="data[password]" id="password" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>-->
<!--<span class="glyphicon glyphicon-eye-close form-control-feedback"></span>-->
<!--<span class="glyphicon glyphicon-eye-close form-control-feedback"></span>-->
</div>
</div>
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
<div class="form-group has-feedback">
<div class="form-group has-feedback">
<div class="col-md-12">
<div class="col-md-12">
<label class="label-text-sub"><?php echo __('Confirm password');?><em>* </em></label>
<label class="label-text-sub"><?php echo __('Confirm password');?><em>* </em></label>
<input data-toggle="password" data-placement="before" type="password" name="confirm_password" id="confirm_password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from
" style="padding:0px 0px !important;"
>
<input data-toggle="password" data-placement="before" type="password" name="confirm_password" id="confirm_password" value="" placeholder="********" class="form-control input-lg color-button-border border-bottom-from
required" style="padding:0px 0px !important;" minlength=8
>
<!--<input type="password" id="confirm_password" name="data[confirm_password]" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>-->
<!--<input type="password" id="confirm_password" name="data[confirm_password]" value="" placeholder="********" class="form-control-reg border-bottom-from" onkeyup='check();'>-->
<!--<span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>-->
<!--<span class="glyphicon glyphicon-eye-close form-control-feedback" id='message'></span>-->
<span id='message'></span>
<span id='message'></span>
...
@@ -214,6 +214,15 @@
...
@@ -214,6 +214,15 @@
})
})
$("#fremail").on('change',function(){
$("#fremail").on('change',function(){
var elem = document.getElementById('fremail').value;
console.log(elem);
if(!elem.match(/^([A-Za-z0-9@._])+$/i)){
alert("<?php echo __('Wrong email address format Please enter the correct number.');?>");
return false;
}
})
$("#fremail").on('change',function(){
var email = document.getElementById("fremail").value;
var email = document.getElementById("fremail").value;
$.post("/Checkemails/checkemail", {email: email}, function(data) {
$.post("/Checkemails/checkemail", {email: email}, function(data) {
// console.log(data);
// console.log(data);
...
@@ -225,119 +234,23 @@
...
@@ -225,119 +234,23 @@
});
});
});
});
});
});
function check_phone() {
//
function check_phone() {
e_k=event.keyCode
// e_k=event.keyCode
// if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) {
// // if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) {
if (e_k = 10 && (e_k < 48) || (e_k > 59)) {
// if (e_k = 10 && (e_k < 48) || (e_k > 59)) {
event.returnValue = false;
// event.returnValue = false;
alert("<?php echo __('Please enter the phone number. Only numbers.');?>");
// alert("<?php echo __('Please enter the phone number. Only numbers.');?>");
}
// }
}
// }
function check_notnum() {
var letters = /^[A-Za-zก-๙]+$/;
if(letters.test( event.key )==false){
alert("<?php echo __('Please enter the correct Thai or English text.');?>");
return false;
}
}
function checkeng()
{
e_k=event.keyCode
if ((e_k >= 48 && e_k<=57) || (e_k>=97 && e_k<=122) || ((e_k>=65 && e_k<=90))) {
e_k = true;
}else{
e_k = false;
alert("<?php echo __('Please enter only English letters and numbers.');?>");
}
}
function validateForm() {
function validateForm() {
var firstname = document.getElementById("firstname").value;
if (firstname == null || firstname == "") {
alert("<?php echo __('Please enter your firstname.');?>");
return false;
}
var lastname = document.getElementById("lastname").value;
if (lastname == null || lastname == "") {
alert("<?php echo __('Please enter your lastname.');?>");
return false;
}
var username = document.getElementById("username").value;
if (username == null || username == "") {
alert("<?php echo __('Please enter your username.');?>");
return false;
}
if(document.getElementById("username").value.length < 4 || document.getElementById("username").value.length > 10)
{
alert("<?php echo __('Please enter a 4-10 character username.');?>");
return false;
}
var master_country_id = document.getElementById("master_country_id").value;
if (master_country_id == null || master_country_id == "") {
alert("<?php echo __('Please specify country');?>");
return false;
}
var master_province_id = document.getElementById("master_province_id").value;
if (master_province_id == null || master_province_id == "") {
alert("<?php echo __('Please specify province');?>");
return false;
}
var birthdate = document.getElementById("date").value;
if (birthdate == null || birthdate == "") {
alert("<?php echo __('Please enter the date of your birth.');?>");
return false;
}
var moblie_no = document.getElementById("moblie_no").value;
if (moblie_no == null || moblie_no == "") {
alert("<?php echo __('Please enter your phone number.');?>");
return false;
}
if(document.getElementById("moblie_no").value.length != 10)
{
alert("<?php echo __('Please enter a 10 digit phone number.');?>");
return false;
}
var email = document.getElementById("fremail").value;
if (email == null || email == "") {
alert("<?php echo __('Please enter your email.');?>");
return false;
}
// Validate Email
var email = $("#fremail").val();
if (/(.+)@(.+){2,}\.(.+){2,}/.test(email)) { } else {
alert("<?php echo __('Wrong email address format Please enter the correct number.');?>");
return false;
}
var password = document.getElementById("password").value;
var password = document.getElementById("password").value;
if (password == null || password == "") {
alert("<?php echo __('Please enter your password.');?>");
return false;
}
if(document.forms["createAccount"]["password"].value.length < 8)
{
alert("<?php echo __('Please enter at least 8 characters.');?>");
return false;
}
var confirm_password = document.getElementById("confirm_password").value;
var confirm_password = document.getElementById("confirm_password").value;
if
(confirm_password == null || confirm_password == "")
{
if
(confirm_password = document.getElementById("password").value != document.getElementById("confirm_password").value)
{
alert("<?php echo __('Please
verify
your password.');?>");
alert("<?php echo __('Please
provide
your password.');?>");
return false;
return false;
}
}
if(confirm_password = document.getElementById("password").value != document.getElementById("confirm_password").value){
alert("<?php echo __('Please provide your password.');?>");
//document.createAccount.confirm_password.focus();
return false;
}
if($("#accept:checked").length==0){
if($("#accept:checked").length==0){
alert("<?php echo __('Please accept the Terms of Use.');?>");
alert("<?php echo __('Please accept the Terms of Use.');?>");
...
@@ -347,12 +260,6 @@
...
@@ -347,12 +260,6 @@
$("body").delegate(".is_active", "click", function () {
$("body").delegate(".is_active", "click", function () {
$('.is_active').not(this).prop('checked', false);
$('.is_active').not(this).prop('checked', false);
return true;
return true;
// var id = $(this).closest('td').find('#idAddresses').val();
// var id_card13 = $(this).closest('td').find('#idCard13Addresses').val();
// console.log(id);
// $.post("/Addresses/currentAddress", {id: id, id_card13 : id_card13}, function(data) {
// location.reload();
// });
});
});
}
}
...
@@ -552,30 +459,6 @@
...
@@ -552,30 +459,6 @@
});
});
</script>
</script>
<!--------------------------------- confirm password ------------------------------ -->
<script>
// function check_phone() {
// e_k=event.keyCode
// //if (((e_k < 48) || (e_k > 57)) && e_k != 46 ) {
// if (e_k = 10 && (e_k < 48) || (e_k > 57)) {
// event.returnValue = false;
// alert("ขออภัยหมายเลขโทรศัพท์ ต้องเป็นตัวเลขเท่านั้น");
// }
// }
/*var check = function() {
if (document.getElementById('password').value ==
document.getElementById('confirm_password').value) {
document.getElementById('message').style.color = 'green';
document.getElementById('message').innerHTML = '';
} else {
document.getElementById('message').style.color = 'red';
document.getElementById('message').innerHTML = '';
}
}*/
</script>
<!--------------------------------- date ------------------------------------->
<script>
<script>
$(document).ready(function(){
$(document).ready(function(){
var date_input=$('input[id="date"]'); //our date input has the name "date"
var date_input=$('input[id="date"]'); //our date input has the name "date"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment