mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 16:39:55 +02:00
Story#113524121 - validate in web max file
This commit is contained in:
parent
6f4ff0fd46
commit
cf3fce8055
4 changed files with 15 additions and 30 deletions
|
@ -21,18 +21,3 @@
|
|||
= button_tag t(:save), class: 'btn btn-warning'
|
||||
- else
|
||||
= button_tag t(:create), class: 'btn btn-warning'
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
var fileInput = $('#depp_contact_legal_document');
|
||||
var minSize = '1000';
|
||||
$('form').submit(function(e){
|
||||
if(fileInput.get(0).files.length){
|
||||
var fileSize = fileInput.get(0).files[0].size;
|
||||
if(fileSize < minSize){
|
||||
alert('Document size is less then' + minSize + ' bytes');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
|
@ -10,4 +10,4 @@
|
|||
= f.label :legal_document, t(:legal_document)
|
||||
%p.help-block= t(:legal_document_max_size)
|
||||
.col-md-7
|
||||
= f.file_field :legal_document, :value => ''
|
||||
= f.file_field :legal_document, :value => '', data: {legal_document: true}
|
||||
|
|
|
@ -32,17 +32,3 @@
|
|||
$(function () {
|
||||
$('#tabs a:first').tab('show')
|
||||
})
|
||||
|
||||
$(function(){
|
||||
var fileInput = $('#domain_legal_document');
|
||||
var minSize = '1000';
|
||||
$('form').submit(function(e){
|
||||
if(fileInput.get(0).files.length){
|
||||
var fileSize = fileInput.get(0).files[0].size;
|
||||
if(fileSize < minSize){
|
||||
alert('Document size is less then' + minSize + ' bytes');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue