4_15_2019 update

This commit is contained in:
Frank John Begornia
2019-04-15 22:38:53 +08:00
parent 0fe1270756
commit c5862dfbf4
665 changed files with 401297 additions and 194 deletions

View File

@@ -706,6 +706,44 @@
submitHandler: submitFormVerificationCode
});
$("#frm_sell_design").validate({
rules: {
itemName: {
required: true
},
itemDescription: {
required: true
},
itemPrice: {
required: true
},
itemForm: {
required: true
},
itemUrl: {
required: true
},
itemPrivacy: {
required: true
},
},
messages: {},
errorPlacement: function(error, element) {
var placement = $(element).data('error');
if (placement) {
$(placement).append(error)
}else {
error.insertAfter(element);
}
},
submitHandler: submitSellDesignForm
});
$(document).on('button click', '#chk-currentpass', function(){
if($(this).is(':checked')){
@@ -793,9 +831,6 @@
});
$('.image-thumbnails').click(function(){
// console.log($(this)[0].firstElementChild.geAttribute('class'))
// console.log($(this).attr('src'))
@@ -832,6 +867,13 @@
});
$("#itemName").on('keyup',function(){
var getsportName = $(this).val();
getsportName = getsportName.replace(/\s+/g, '-').toLowerCase(); //new object assigned to var str
$("#product_url").val(getsportName);
});
});
// function
@@ -1081,7 +1123,36 @@
}, 1000);
}
}
function submitSellDesignForm(){
var data = $("#frm_sell_design").serialize();
$.ajax({
type : 'POST',
url : "{{ url('user/my-designs/addstoreitem') }}",
data : data,
dataType: 'json',
beforeSend:function(xhr){
var token = $('meta[name="csrf_token"]').attr('content');
if (token) {
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
}
xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest');
},
success : function(response){
console.log(response);
if(response.success){
alert("Item is successfully added to your store.");
location.reload();
}else{
$("#sell-design-response-msg").html(response.message);
}
}
});
return false;
}
</script>
</body>