0

我有两个<input type=Button>。单击时,两者都将加载一个包含在 div 中的对话框。

我想在 div 中添加一个单独的按钮和文本,只有在单击第二个按钮时才能查看。而不是为 btn 1 重写这个,为 btn 2 重写一个。如果单击第二个 btn,我怎样才能使额外的文本和按钮可用?

<div id="LabourOrPlantDialog" title="Comments" style="display:none;">
   <table class="table">
      <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()" />

   <!-- BELOW IS THE TEXT AND BTN I ONLY WANT AVAILABLE WHEN 2ND BTN IS CLICKED -->

   <input type="text" name="BoqTextBox" />
   <input type="AddValueButton" value="+" onclick="Add(BoqTextBox)" />                          
</div>

某种布尔我猜?以前从未这样做过......任何帮助都会很棒。谢谢


编辑:

<input id="SubmitCommentsForOne" type="button" value="Comments" onclick="ShowComment('<%: item.ItemCode %>')" />

<input id="SubmitCommentsForTwo" type="button" value="Comments" onclick="ShowComment('<%: item.Number %>')" />
var Code
function ShowCommentBoxForBOQ(Number) {
   Code = Number;
   Work.DisplayBoxForBOQ(Number);
   $("#LabourOrPlantDialog").dialog({ modal: true });
}

LabourOrPlantDialog加载 div。


编辑:我可以提供任何其他有帮助的东西吗?有人知道个子高吗?感谢您的任何回复

4

1 回答 1

2
  1. 将其添加到您想要的新文本和按钮的任何位置:

    <div id="hiddenBox">
      <input type="text" name="BoqTextBox" />
      <input type="button" value="+" onclick="Add(BoqTextBox);" /> 
    </div>
    
  2. 在样式表的某处添加:

    #hiddenBox{display:none;}
    
  3. 在你的 javascript 中添加这个

    $("#SubmitCommentsForTwo").click(function(){
        $("#hiddenBox").show();  
    });
    
于 2013-03-22T17:57:38.133 回答