程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了在 Bootstrap Modal 中单击提交后如何展开特定的 HTML 表?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决在 Bootstrap Modal 中单击提交后如何展开特定的 HTML 表??

开发过程中遇到在 Bootstrap Modal 中单击提交后如何展开特定的 HTML 表?的问题如何解决?下面主要结合日常开发的经验,给出你关于在 Bootstrap Modal 中单击提交后如何展开特定的 HTML 表?的解决方法建议,希望对你解决在 Bootstrap Modal 中单击提交后如何展开特定的 HTML 表?有所启发或帮助;

我在 a 标签的标题下有 3 个 HTML 表格行。当我点击 a 标签时,表格会展开以显示其内容。单击相同将关闭表格。现在,我已经集成了 bootstrap modal 并且我将它重用于所有表。单击任何 a 标签后,可以打开和关闭模态。但是对于任何表格,在模态提交时,它应该展开表格以查看其内容。我已经成功地为一张桌子完成了这项工作。当我对其他表应用相同时,提交时它会扩展所有表。请告诉我如何通过提交模态来解决这个问题,它应该针对特定的 a 标签表内容展开。下面是我的代码:

HTML

<div class="section">
   <a class="section-title detail-head" onclick="imp(this.INNERHTML)" data-toggle="modal" 
         data-target="#mymodal"> GuIDelines and Templates </a>

      <div ID="accordion-1" class="section-content" style="display:none;">
           <table class="LisTingArea">
               <------ Contents ------>
            </table>
      </div>
</div>
<div class="section">
   <a class="section-title detail-head" onclick="imp(this.INNERHTML)" data-toggle="modal" 
         data-target="#mymodal"> GuIDelines and Templates - 2 </a>

      <div ID="accordion-2" class="section-content" style="display:none;">
           <table class="LisTingArea">
               <------ Contents ------>
            </table>
      </div>
</div>

<div class="section">
   <a class="section-title detail-head" onclick="imp(this.INNERHTML)" data-toggle="modal" 
         data-target="#mymodal"> GuIDelines and Templates - 3 </a>

      <div ID="accordion-3" class="section-content" style="display:none;">
           <table class="LisTingArea">
               <------ Contents ------>
            </table>
      </div>
</div>

<button class="submit btn btn-success" type="button" ID="user-submit" onclick="createItem(); return false" value="submit" style="margin-left:-200px;">submit</button>

Js

 function imp(X) {
  var k=x.trim();                    
  document.getElementByID("edit-practice").value = k;
  modalFunction();     
  }

function modalFunction(){
        $('#accordion-1').hIDe();               
            if($('#mymodal').is(':visible')){
               $('#mymodal').hIDe();
                  }else{
                        $('#mymodal').show();   
                       }
 }

function createItem() {

<--- API things and other @R_197_11561@ffs --->

function acc1() {
    $('#accordion-1').show(); 
    $('#mymodal').hIDe(); 
 }
   acc1();
}

这是 Narendra 的解决方案(感谢他)我尝试过一张桌子 (#accordion-1)。当我将其应用于其他表 (#accordion-2,3,4) 时,提交时它会一次扩展所有表。请帮助我如何使用相同的模式在其他 2 个表中进行操作。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的在 Bootstrap Modal 中单击提交后如何展开特定的 HTML 表?全部内容,希望文章能够帮你解决在 Bootstrap Modal 中单击提交后如何展开特定的 HTML 表?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。