Current File : /data/web/virtuals/215191/virtual/www/domains/skoly-skolky.cz/adm/tpl/flyer/form_insert_flyer.tpl |
<div id="form_insert_flyer_wrap" class="contentBox">
<h3 class="contentBoxTop">Vložit / upravit leták</h3>
<form id="form_insert_flyer" class="form innerContent" action="do_form.php" method="post">
<label>*Název:</label>
<input id="flyer_name" type="text" class="input_text" name="flyer[name]" value="<## param="name" column="name" ##>" /><br />
<br />
<label>Perex:</label>
<textarea id="flyer_perex" cols="60" rows="3" name="flyer[perex]"><## param="description" column="description" ##></textarea>
<br />
<label>Popis:</label>
<textarea id="flyer_description" cols="60" rows="10" name="flyer[description]"><## param="description" column="description" ##></textarea>
<br />
<input type="hidden" id="flyer_file_name" name="flyer[file_name]" />
<div id="flyer_file" style="width:500px"></div>
<script type="text/javascript">
$('#flyer_file').ajaxupload({
url:'fe/upload.php',
remotePath:'../../img/flyers/',
maxFiles: 20,
editFilename: true,
success: function(fname){
//console.log(fname);
/*$('#flyer_file_name').attr('value',fname);
$('#form_insert_flyer').unbind('submit');
$('#form_insert_flyer').submit();*/
},
finish: function(result) {
//console.log(result);
$('#flyer_file_name').attr('value',result);
$('#form_insert_flyer').unbind('submit');
$('#form_insert_flyer').submit();
}
});
$('#flyer_file').ajaxupload('getFiles');
</script>
<br />
<!--div class="right_side width_30">
<## param="projectors" column="projectors" ##>
</div-->
<input type="hidden" name="send_form" value="<## param="call" column="call" ##>" />
<input type="hidden" name="flyer[id]" value="<## param="id" column="id" ##>" />
<input type="submit" value="uložit" class="button_submit" />
<a href="<## param="page" column="page" ##>" class="button_storno" />zrušit</a>
<br class="clear" />
</form>
<script type="text/javascript">
/* <![CDATA[ */
$('#flyer_name').validator({
invalidEmpty: true,
error: function(){
errorMark($(this),'povinné pole');
}
});
$('#flyer_file_name').validator({
invalidEmpty: true,
error: function(){
errorMark($(this),'musíte vybrat a nahrát mediální soubor');
}
});
/*
$('#medium_description').validator({
invalidEmpty: true,
error: function(){
errorMark($(this),'povinné pole');
}
});*/
var $v = [];
function sendForm(e){
e.preventDefault();
$('span.err_bubble').remove();//odstrani chybove hlasky
$('.error_field').removeClass('error_field');
//$v[0] = $('#medium_file_name').validator('validate');
$v[0] = $('#flyer_name').validator('validate');
if($.inArray(false,$v) == -1){
$('#flyer_file').ajaxupload('start');
}else{
return false;
}
return false;
}
$('#form_insert_flyer').submit(function(e){
sendForm(e);
});
/* ]]> */
</script>
</div>