ajax bei download raus
This commit is contained in:
parent
a3656f432b
commit
88f9b1bff6
@ -58,20 +58,14 @@ class VinylDownload {
|
||||
// max count not reached
|
||||
if ( false === $this->reached_max_dl( $row['count'] ) ) {
|
||||
$content ='
|
||||
|
||||
<div id="1">
|
||||
<p>Du hast noch <strong>' . ( self::MAXDOWNLOADS - $row['count'] - 1 ) .'</strong> Downloads zur Verfügung bis der Code ungültig wird.
|
||||
<div id="1">
|
||||
<form method=POST id="dl-trigger" action="https://www.rainervonvielen.de/digital-download"><p>
|
||||
<input type="hidden" value="'. $this->code . '" name="c">
|
||||
<input type="hidden" value="'. $f . '" name="sel_format">
|
||||
<input type="submit" class ="btn middle" value="Start">
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
jQuery("#dl-trigger").submit(function(e) {
|
||||
jQuery("#1").html( "<p><strong>Download ist gestartet.</strong> Du hast noch <strong>' . ( self::MAXDOWNLOADS - $row['count'] - 1 ) .'</strong> Downloads zur Verfügung bis der Code ungültig wird." );
|
||||
});
|
||||
return true;
|
||||
</script>
|
||||
|
||||
';
|
||||
}
|
||||
|
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user