JMJS系统总结系列----HTML标签在XSLT 中的应用(二)

文本框:

<input name="Accept/ApprovalItemName" align="left" type="text" title="申请项目" myClass="txt|y|0|100" maxlength="100" class="form_input w_bfb98" id="Accept/ApprovalItemName" >

<xsl:attribute name ="value">

<xsl:value-of select="Accept/ApprovalItemName"/>

</xsl:attribute>

</input>

时间控件:

<input type="text" name="Accept/AcceptDate" class="Wdate w_bfb98" title="受理日期" myClass="txt|y|0|25" maxlength="25" id="Accept/AcceptDate" style="width:45%;" onclick="javascript:WdatePicker();">

<xsl:attribute name="value">

<xsl:call-template name="FormatDate">

<xsl:with-param name="DateTime" select="Accept/AcceptDate"/>

</xsl:call-template>

</xsl:attribute>

</input>

textarea多行文本框:

<textarea name="Accept/Remarks" id="Accept/Remarks" maxlength="2000" cols="45" rows="5" class="form_input txtarea_h85 w_bfb98">

<xsl:value-of select="Accept/Remarks"/>

</textarea>

chackbox复选框:

<input type="checkbox" id="IsExchange" iid="Accept/IsExchange" value="1" onclick="checkedYesNo(this);">

<xsl:if test="Accept/IsExchange=1">

<xsl:attribute name="checked"></xsl:attribute>

</xsl:if>

</input>

<input type="hidden" name="Accept/IsExchange" id="Accept/IsExchange">

<xsl:attribute name="value">

<xsl:value-of select="Accept/IsExchange"/>

</xsl:attribute>

</input>

<label for="IsExchange">是否交换到市行政审批平台</label>

通过脚本checkedYesNo(this)设置隐藏控件IsExchange的值,提交时,保存IsExchange的值。

select下拉选择框:

<select name="Accept/IsAccept" id="Accept/IsAccept" class="form_input w_bfb80" onchange="GetAcceptNumber(this);">

<option value=""></option>

<option value="1">

<xsl:if test="Accept/IsAccept=1">

<xsl:attribute name="selected"></xsl:attribute>

</xsl:if>已受理

</option>

<option value="2">

<xsl:if test="Accept/IsAccept=2">

<xsl:attribute name="selected"></xsl:attribute>

</xsl:if>不受理

</option>

</select>

代码选择框:

<input name="Accept/Project/TradeTypeName" type="text" title="行业类别及代码" myClass="txt|y|0|255" readonly="true" class="form_input w_bfb80" id="Accept/Project/TradeTypeName">

<xsl:attribute name="value">

<xsl:value-of select="Accept/Project/TradeTypeName"/>

</xsl:attribute>

</input>

<input name="Accept/Project/TradeTypeCodeID" type="hidden" id="Accept/Project/TradeTypeCodeID" >

<xsl:attribute name="value">

<xsl:value-of select="Accept/Project/TradeTypeCodeID"/>

</xsl:attribute>

</input>

&#160;&#160;<img src="images/icon_upload.gif" width="16" height="16" onclick="javascript:SelectTradeType();"></img>

a.通过SelectTradeType()脚本设置隐藏控件TradeTypeCodeID的值,提交时,保存TradeTypeCodeID的值。

b.对于代码选择框,必须设置隐藏控件TradeTypeCodeID的属性,否则,编辑保存时,可能会提交空值。最终,导致原来填写的值丢失。

<xsl:attribute name="value">

<xsl:value-of select="Accept/Project/TradeTypeCodeID"/>

</xsl:attribute>

radio单选框:

<input TYPE="radio" id="ProjectKind0" name="Accept/Project/ProjectKind" value="0">

<xsl:if test="Accept/Project/ProjectKind = 0">

<xsl:attribute name="checked">

</xsl:attribute>

</xsl:if>

<label for="ProjectKind0">新建</label>

</input>

<xsl:text disable-output-escaping="yes">&#160;&#160;</xsl:text>

<input TYPE="radio" id="ProjectKind2" name="Accept/Project/ProjectKind" value="1">

<xsl:if test="Accept/Project/ProjectKind = 1">

<xsl:attribute name="checked">

</xsl:attribute>

</xsl:if>

<label for="ProjectKind2">改扩建</label>

</input>

<xsl:text disable-output-escaping="yes">&#160;&#160;</xsl:text>

<input TYPE="radio" id="ProjectKind1" name="Accept/Project/ProjectKind" value="2">

<xsl:if test="Accept/Project/ProjectKind = 2">

<xsl:attribute name="checked">

</xsl:attribute>

</xsl:if>

<label for="ProjectKind1">技术改造</label>

Name属性设置的值一致,提交时,只提交一个值。

posted @ 2011-08-30 18:34  远大 光明  阅读(608)  评论(0编辑  收藏  举报