Skip to content

Commit

Permalink
Merge branch 'ds/issue52' into 'develop'
Browse files Browse the repository at this point in the history
fix:'Validate' button to validate permalink 🐛

See merge request PBSA/dapps/NFT-store!12
  • Loading branch information
RoshanSyed committed Jun 4, 2021
2 parents 9b08ed0 + 424aca5 commit 8059d0e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions public/javascripts/expressCart.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ $(document).ready(function (){
}
});

$('#validatePermalink').on('click',function(){
if($('#productPermalink').val() !== ''){
$.ajax({
method: 'POST',
url: '/admin/validatePermalink',
data: { permalink: $('#productPermalink').val(), docId: $('#productId').val() }
})
.done(function(msg){
showNotification(msg.message, 'success');
})
.fail(function(msg){
showNotification(msg.responseJSON.message, 'danger');
});
}else{
showNotification('Please enter a permalink to validate', 'danger');
}
})

$('#productNewForm').validator().on('submit', function(e){
e.preventDefault();
if($('#productPermalink').val() === '' && $('#productTitle').val() !== ''){
Expand Down
3 changes: 2 additions & 1 deletion views/partials/nftMintModal.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<input type="hidden" id="productId" value="">
<div class="form-group">
<label for="productQuantity" class="control-label">{{ @root.__ "Product quantity" }} *</label>
<input type="number" id="productQuantity" class="form-control" min="0" step="1" required/>
<input type="number" id="productQuantity" class="form-control" min="0" step="1"
onkeydown="if(event.key==='.'){event.preventDefault();}" onpaste="let pasteData = event.clipboardData.getData('text'); if(pasteData){pasteData.replace(/[^0-9]*/g,'');} " required/>
</div>
</form>
</div>
Expand Down

0 comments on commit 8059d0e

Please sign in to comment.