丄諦啲仇魜ヤ
如 果 敌 人 让 你 生 气 , 那 说 明 你 没 有 胜 他 的 把 握!
posts - 6,comments - 56,trackbacks - 1

 

<script type="text/javascript">
function check(form)
{

var value 
= form["fileform:文档名称"].value;
var value2 
= form["fileform:上传文件"].value;
if(!value){
alert(
"文档名不能为空!");
form[
"fileform:文档名称"].focus();
return false;
}

if(!value2){
alert(
"上传的文档不能为空!");
form[
"fileform:上传文件"].focus();
return false;
}


}

</script>

 

   
   
<h:form enctype="multipart/form-data" id="fileform">
    
<h:panelGrid columns="2">
                
        
<h:outputText value="文档名称:" styleClass="list01"/>
        
<h:panelGroup>
        
<h:inputText id="文档名称" value="#{fileUpload.filename}"  />
        
<h:outputLabel style="color:red" value="*"></h:outputLabel>
        
</h:panelGroup>
         
<h:outputText value="选择文档:" styleClass="list01"/>
        
<h:panelGroup>
        
<x:inputFileUpload id="上传文件" value="#{fileUpload.myFile}" storage="file" />
        
<h:outputLabel style="color:red" value="*"></h:outputLabel>
                   
</h:panelGroup>
                   
        
<h:outputText value="关键字:" styleClass="list01"/>
        
<h:inputText value="#{fileUpload.fileGJZ}"/>
        
         
<h:commandButton action="#{fileUpload.processFile}" value="提  交" onclick="return check(this.form)"/>
          
<h:commandButton value="重  置" type="reset"/>
         
       
    
</h:panelGrid>  
    
   
</h:form>



没有表单 FORM 时

<h:commandButton action="#{fileUpload.processFile}" value="提  交" onclick="return test('#{fileUpload.filename}')"/>

posted on 2008-12-23 15:26 Crying 阅读(253) 评论(0)  编辑  收藏 所属分类: JSF

只有注册用户登录后才能发表评论。


网站导航: