$(document).ready(function() { $(".but").button(); $("#yhteystiedot").ajaxForm({ target: "#debug", success: function(data) { $.each(data.items, function(i,item){ if (typeof item.cont != 'undefined') $("#"+item.id).html(item.cont); if (typeof item.addclass != 'undefined') $("#"+item.id).addClass(item.addclass); if (typeof item.removeclass != 'undefined') $("#"+item.id).removeClass(item.removeclass); }) }, dataType: "json" }); $(".itial").on("focus", function() { $(this).val(''); $(this).text(''); $(this).css({'color' : 'inherit'}); }); $(".itialt").on("focus", function() { $(this).html(''); $(this).css({'color' : 'inherit'}); }); var myup = $("#fileuploader").uploadFile({ url:"/upload/index.php", autoSubmit:true, multiple:true, dragDropStr: " tai raahaa tiedostot tähän", doneStr: "valmis", uploadStr: "Valitse", dynamicFormData: function() { var mesg = new Object; mesg.sentto = $("[name='sentto']").val(); mesg.nimi = $("[name='nimi']").val(); mesg.email = $("[name='email']").val(); mesg.puhelin = $("[name='puhelin']").val(); mesg.työnimi = $("[name='työnimi']").val(); mesg.työnumero = $("[name='työnumero']").val(); mesg.lisätiedot = $('#lisätiedot').val(); return mesg; }, returnType:"json", onSuccess: function(files,data,xhr,pd) { // $("#debuge").html($("#debuge").html()+"
Success for: "+JSON.stringify(data)); $("body").css("cursor", "default"); $.each(data.items, function(i,item){ if (typeof item.cont != 'undefined') $("#"+item.id).html(item.cont); if (typeof item.addclass != 'undefined') $("#"+item.id).addClass(item.addclass); if (typeof item.removeclass != 'undefined') $("#"+item.id).removeClass(item.removeclass); }); // $(".ajax-file-upload-container").hide(); $("#debug").hide(); $("#loki").html("
"+files+" siirretty
"+ $("#loki").html()); }, onError: function(files,status,errMsg,pd){ $("body").css("cursor", "default"); $("#loki").html("
Virhe ""+errMsg+"" siirrettäessä kohdetta "+ files +"
"+ $("#loki").html()); }, onSubmit:function(files,hdr) { $(".ajax-file-upload-container").show(); $("body").css("cursor", "progress"); $("#debug").show(); }, afterUploadAll:function(obj) { $(".ajax-file-upload-container").hide(); // $("#alldone").html($("#alldone").html()+"
All files are uploaded"); }, onCancel:function(files,pd) { $("#debug").show(); $("#debug").html($("#debug").html()+"
Canceled files: "+JSON.stringify(files)); }, fileName:"liite" }); $("#uploadb").click(function() { myup.startUpload(); }); $('input:text, input:password, textarea') .button() .css({ 'font' : 'inherit', 'color' : 'grey', 'text-align' : 'left', 'outline' : 'none', 'cursor' : 'text', 'margin-bottom' : '2px', 'width' : '400px', 'border-radius' : '0px 0px 0px 0px' }); $('#sentto').selectmenu(); /* $('#sentto').on( "selectmenuselect", function( event, ui ) { }); */ $('.ui-selectmenu-button').css({ 'width' : '397px', 'margin-bottom' : '2px', 'border-radius' : '0px 0px 0px 0px' }); });