From 88f9b1bff6fdfde853caa66dd67a1730ac9922a8 Mon Sep 17 00:00:00 2001 From: Daniel Schubert Date: Thu, 2 Mar 2017 22:13:56 +0100 Subject: [PATCH] ajax bei download raus --- VinylDownload.class.php | 10 ++-------- includes/js/ajax.js | 4 ++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/VinylDownload.class.php b/VinylDownload.class.php index 14ff574..e5d19fb 100644 --- a/VinylDownload.class.php +++ b/VinylDownload.class.php @@ -58,20 +58,14 @@ class VinylDownload { // max count not reached if ( false === $this->reached_max_dl( $row['count'] ) ) { $content =' - -
+

Du hast noch ' . ( self::MAXDOWNLOADS - $row['count'] - 1 ) .' Downloads zur Verfügung bis der Code ungültig wird. +

- '; } diff --git a/includes/js/ajax.js b/includes/js/ajax.js index 19497de..6f4ce73 100644 --- a/includes/js/ajax.js +++ b/includes/js/ajax.js @@ -5,8 +5,12 @@ jQuery(document).ready(function($) { e.preventDefault(); // this disables the submit button so the user stays on the page // Validation + let code = $('input[name=code]').val(); + if ( code.length < 8 ) { + jQuery('#resp').html('Code ist zu kurz!'); + } else { data = {'code' : $('input[name=code]').val(),