</s:textfield>去掉自动生成的<tr><td>

在使用Struts2框架时,若<s:textfield>标签默认生成了<tr><td>元素,可以通过设置theme属性为'simple'来避免。同时,在struts.xml中配置全局theme为'simple'也能实现统一效果。
</s:textfield>去掉自动生成的<tr><td>
在使用struts2的时候发现如果按照默认的方式使用<s:textfield>标签,会自动加上<tr><td>标签,比如

<s:textfield key="username"/>



会显示成

<tr><td><input type=text name=username/></td></tr>



有时候并不需要这些td tr,所以可以这样写

<s:textfield key="username" theme="simple"/>

或者在struts.xml中加入

<constant name="struts.ui.theme" value="simple" />

这样全部默认使用simple

注:默认的theme是xhtml
请详细逐行分析下面代码:<script> String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } function reloadFormForErcCategory(object){ /*remove the lot type check var value=object.value; var lotType="${requestForm.lotType?default('')?if_exists}"; if(lotType=="P" | lotType=="R" | lotType=="M" |lotType=="B" |lotType=="E1" |lotType=="E2"|lotType=="E3" |lotType=="E9"){ if(value!="Input the STR Number" && value!="STR" && value!="MSTR") { alert("Because the lotType is "+lotType+ ". Please select 'the For STR/MSTR lots(Pls input the effective STR or MSTR number)' in RunCard Category, and input the STR# ! "); return false; } }*/ checkRuncardStatus(); var form = document.forms['updateRequestForm']; form.action="saveRequestForm.action"; form.submit(); } function IsChar(s) { var Number ="0123456789.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\":;.,?'|-_ "; for (i = 0; i < s.length;i++) { // Check that current character isn't whitespace. var c = s.charAt(i); if (c!="\r" && c!="\n"&&Number.indexOf(c) == -1) {return false;} } return true } function realLength (str) { return str.replace(/[^\x00-\xff]/g,"**").length; } function CheckChar(theField) { var value=theField.value; var reg=/\s/g; var stringLength=value.replace(reg,""); if(stringLength.length>150){ alert("最多150个字符!"); theField.focus(); return false; } if(stringLength.length!=realLength(stringLength)) { alert("只能输入英文或数字,请不要输入中文或特殊字符!"); theField.value=""; theField.focus(); return false; } if (!IsChar(theField.value)) { alert("只能输入英文或数字,请不要输入中文或特殊字符!"); theField.value=""; theField.focus(); } } </script> <tr> <th colspan="4">RunCard Header</th> </tr> <tr class="b"> <td>RunCard Category:</td> <td colspan="3"><#--@ww.select name="'requestForm.ercCategory'" list="{'Rework(<3 lots for one case with same reason)','Normal Condition Split(split on qualified comparison or split within spec)','Add Measurement','For Customer Request','Input the STR Number','Expriment on scrap wafer(<1 lot and must scrap in 3 stages after experiment)','Expriment on scrap wafer(<1 lot and must change lot type to engineering lot type before experiment)'}" headerKey="'Please Select'" headerValue="'Please Select'" onchange="'reloadFormForErcCategory()'" emptyOption="false" theme="'simple'"/--> <#if requestForm.ercCategory?if_exists=="STR" || requestForm.ercCategory?if_exists=="MSTR"> <select name="requestForm.ercCategory"> <option value="${requestForm.ercCategory?if_exists}">${requestForm.ercCategory}</option> </select> <#else> <select name="requestForm.ercCategory" onchange="reloadFormForErcCategory(this)" <#if requestForm.formType?if_exists=="Scan Defect">disabled=true</#if>> <option <#if requestForm.ercCategory?has_content> <#if requestForm.ercCategory=="Normal Condition Split"> selected="selected"</#if></#if> value="Normal Condition Split">Normal Condition Split(split on qualified comparison or split within spec)</option> <option <#if requestForm.ercCategory?has_content> <#if requestForm.ercCategory=="Rework"> selected="selected"</#if></#if> value="Rework">Rework(<3 lots for one case with same reason)</option> <option <#if requestForm.ercCategory?has_content> <#if requestForm.ercCategory=="Add Measurement" || requestForm.ercCategory=="need reposition"> selected="selected"</#if></#if> value="need reposition"> Add Measurement(Normal, need fill reposition step information)</option> <option <#if requestForm.ercCategory?has_content> <#if requestForm.ercCategory=="no reposition"> selected="selected"</#if></#if> value="no reposition">Add Measurement( Scan defect without reposition step)</option> <option <#if requestForm.ercCategory?has_content> <#if requestForm.ercCategory=="For Customer Request"> selected="selected"</#if></#if> value="For Customer Request">For Customer Request(Pls input the EN number)</option> <option <#if requestForm.ercCategory?has_content> <#if requestForm.ercCategory=="Input the STR Number"> selected="selected"</#if></#if> value="Input the STR Number">For STR/MSTR lots(Pls input the effective STR or MSTR number)</option> <option <#if requestForm.ercCategory?has_content> <#if requestForm.ercCategory=="Experiment on scrap wafer"> selected="selected"</#if></#if> value="Experiment on scrap wafer">Experiment on scrap wafer(<1 lot and must scrap in 3 stages after experiment)</option> <option <#if requestForm.ercCategory?has_content> <#if requestForm.ercCategory=="Experiment on production wafer"> selected="selected"</#if></#if> value="Experiment on production wafer">Experiment on production wafer(<1 lot and must change lot type to engineering lot type before experiment)</option> </#if> </select> </td> </tr> <#if requestForm.ercCategory?exists> <#if requestForm.ercCategory=="For Customer Request"> <tr class="b"> <td>* EN#:</td> <td colspan="3"><@ww.textfield name="'requestForm.strEnNo'" onchange="'javascript:this.value = this.value.trim();'" size="20" theme="'simple'"/></td> </tr> </#if> <#if requestForm.ercCategory=="Input the STR Number"> <tr class="b"> <td>* STR#:</td> <td colspan="3"><@ww.textfield name="'requestForm.strEnNo'" onchange="'javascript:this.value = this.value.trim();'" size="20" theme="'simple'"/></td> </tr> </#if> <#if requestForm.ercCategory=="STR" || requestForm.ercCategory=="MSTR"> <tr class="b"> <td>* STR#:</td> <td colspan="3">${requestForm.strEnNo?if_exists}</td> </tr> </#if> </#if> <tr class="b"> <td>* Purpose:</td> <td colspan="3"><@ww.textarea name="'requestForm.purpose'" value="requestForm.purpose" cols="65" rows="3" onblur="'CheckChar(this)'" theme="'simple'"/></td> </tr> <tr class="b"> <td>* Need to Check:</td> <td colspan="3"><@ww.radio name="'requestForm.needCheck'" list="{'Yes','No'}" theme="'simple'" value="'${requestForm.needCheck?default('Yes'?if_exists)}'" required="true"/>       <font color="red">(Yes - will check product Id consistency with MES)</font> </td> </tr>
09-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Mydwr

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值