Javascript函数双击按钮/单击两次

时间:2013-04-21 19:22:36

标签: javascript jsf file-upload

我做了快速搜索但找不到解决方案,

我是js的新手很抱歉,如果这是一个简单的问题,

但是有可能有一些js,当用户点击一个按钮时,javascript按下按钮两次

这是我希望js可以使用的按钮:

   <p:fileUpload widgetVar="upload" id="upload" fileUploadListener="#{fileUploadController.handleFileUpload}"
                                  mode="advanced" 
                                  multiple="false" 
                                  update="messages Nav upload fileDirectoryViewer"
                                  label="Select File"
                                  sizeLimit="30720000"  
                                  allowTypes="/(\.|\/)(gif|jpe?g|png|doc|txt|pdf|html)$/"
                                  auto="true"
                                  disabled="#{fileUploadController.uploadComplete}"
                                  /> 

这是该页面的源代码:

            <!--&lt;p:growl id=&quot;messages&quot; showSummary=&quot;true&quot; showDetail=&quot;true&quot; /&gt; --><div id="j_idt8:upload" class="ui-fileupload ui-widget"><div class="fileupload-buttonbar ui-widget-header ui-corner-top"><label class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left fileinput-button"><span class="ui-button-icon-left ui-icon ui-c ui-icon-plusthick"></span><span class="ui-button-text ui-c">Select File</span><input type="file" id="j_idt8:upload_input" name="j_idt8:upload_input" /></label></div><div class="fileupload-content ui-widget-content ui-corner-bottom"><table class="files"></table></div></div><script id="j_idt8:upload_s" type="text/javascript">$(function(){PrimeFaces.cw('FileUpload','upload',{id:'j_idt8:upload',mode:'advanced',autoUpload:true,dnd:true,update:'j_idt8:messages j_idt8:Nav j_idt8:upload j_idt8:fileDirectoryViewer',process:'@none',maxFileSize:30720000,acceptFileTypes:/(\.|\/)(gif|jpe?g|png|doc|txt|pdf|html)$/},'fileupload');});</script> 

谢谢你们:)

0 个答案:

没有答案