0
我有两个不同的按钮。这两种方式在点击时运行JQuery函数'ShowCommentBox' 但是,当点击第二个按钮时,我想沿'SHowCommentBox'加载额外的JQuery函数 - 附加功能允许在屏幕上显示额外的选项。2个按钮之一有额外的功能
<input id="SubmitCommentsForBOQ" type="button" value="Comments" onclick="ShowCommentBox('<%: item.ItemCode %>'')" />
以上是第二个按钮,我想也运行
$("#SubmitCommentsForTwo").click(function() {
$("#hiddenBox").show();
});
,这使得可见的额外功能...我怎样才能做到这一点?
谢谢你的任何答复
以下是原始JQuery的:它加载一个对话框
function ShowCommentBox(itemIdentifier, labourOrPlant, desc) {
id = itemIdentifier;
LabouringOrPlanting = labourOrPlant;
description = desc;
Function.DisplayBox(itemIdentifier);
$("#LabourOrPlantDialog").dialog({ modal: true });
}
和我的其他代码:
<div id="LabourOrPlantDialog" title="Comments" style="display:none;">
<table class="detailstable FadeOutOnEdit">
<tr>
<th>Item</th>
</tr>
<tr>
<td id="Item"></td>
</tr>
</table>
<br />
<textarea id="ExistingComments" type="text" runat="server" rows="7" cols="30"
maxlength="2000"> </textarea>
<input id="SubmitComment" type="button" value="Submit"
onclick="SubmitButton()" />
<br />
<div id="hiddenBox">
<input type="text" name="BoqTextBox" id="BoqTextBox" value="7.15" />
</div>
</div>
如果您有两个不同的按钮,为什么不只是更改第二个按钮的onclick函数?他们是两个单独的DOM元素,对吗? – antinescience 2013-03-24 21:11:14