wip file upload

This commit is contained in:
mike-esokia
2018-06-01 17:19:05 +04:00
committed by Mike Ng
parent 3d50c59e89
commit 275730c3fb
3 changed files with 12 additions and 14 deletions

View File

@@ -82,16 +82,6 @@
var height = this.height;
var width = this.width;
//check dimensions
if (height > 42 || width > 52) {
$('#error-text').text(errorDimension);
$('#error-text').show();
$('#help-text').hide();
$('#personalize-image-container').hide();
$('#general_personalize-logo-choice_personalizeLogoInput').val("");
return false;
}
//check file extension
var ext = $('#general_personalize-logo-choice_personalizeLogoInput').val().split('.').pop().toLowerCase();
if (ext != 'png') {
@@ -102,6 +92,17 @@
$('#personalize-image-container').hide();
return false;
}
//check dimensions
if (height > 42 || width > 52) {
$('#error-text').text(errorDimension);
$('#error-text').show();
$('#help-text').hide();
$('#personalize-image-container').hide();
$('#general_personalize-logo-choice_personalizeLogoInput').val("");
return false;
}
fileToUpload = input.files[0];
$('#personalize-image-container').show();
$('#error-text').hide();

View File

@@ -30,8 +30,7 @@
</form>
{{ form_start(form, {'method': 'POST', 'action' : path('setup_display_globals'), 'attr': {'class' : 'form-horizontal'}}) }}
{{ form_start(form, {'method': 'POST', 'action' : path('setup_display_globals'), 'attr': {'class' : 'form-horizontal', 'id': 'setupForm'}}) }}
{{ form_errors(form) }}
{% for daform in form %}
{% if daform.vars['label'] != null %}