question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

data-visible="false" does not create fields if converting from html table

See original GitHub issue

I have an existing table to display a form with multiple rows. I am converting the table to bootstrap-table by editing the table tag.

<table id="table" data-sortable="true" data-toggle="table" data-page-size="50"
                   data-page-list="[50, 100, 200, All]">

It displays fine except for the fact that I have hidden fields that I need to keep for the form POST.

                <thead>
                <tr>
                    <th data-visible="false"></th>
                    <th data-visible="false"></th>
                    <th data-visible="false"></th>
                    <th data-sortable="true">Label</th>
                    <th>Description</th>
                </tr>
                </thead>

The fields are not displayed, however, the fields are also removed from the form.

<thead>
  <tr>
    <th style="" data-field="3">
      <div class="th-inner sortable both">Label</div><div class="fht-cell"></div>
    </th>
    <th style="" data-field="4">
      <div class="th-inner ">Description</div><div class="fht-cell"></div>
    </th><th style="" data-field="5">
      <div class="th-inner sortable both">Location</div><div class="fht-cell"></div>
    </th>
  </tr>
</thead>

...

<tbody>
  <tr data-index="0">
    <td style=""><input type="text" name="form-0-label" value="N29" maxlength="25" id="id_form-0-label"></td>
    <td style=""><textarea name="form-0-desc" cols="40" rows="4" maxlength="500" id="id_form-0-desc">Enrolled at 18 weeks</textarea></td>
    <td style=""><input type="text" name="form-0-location" value="Room 261" maxlength="50" id="id_form-0-location"></td>

I need the hidden fields to be returned with the form’s post. The table worked fine before converting to bootstrap-table.

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wenzhixincommented, Aug 3, 2019

In this case, maybe we can use class to solve the problem. Workaround example: https://live.bootstrap-table.com/code/wenzhixin/384

0reactions
andyp05commented, Aug 19, 2019

Using class display: none seems to work. thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to convert a html table with cells that span into several ...
So, I was trying to get some empty list cells to fill the rest of the row wherever there is an HTML cell...
Read more >
Using table content in a HTML form · Issue #371 - GitHub
Hi, I plan to send the contents of the table such as checkbox, radio button via HTML form. Is it possible? Can you...
Read more >
How to Convert a Static HTML Table to a Dynamic JavaScript ...
In this post we will use the free community edition of AG Grid JavaScript Data Grid to convert from a long static HTML...
Read more >
HTML to PDF Not converting HTML table?
I am trying to convert 3 different HTML files into PDFs using the OneDrive for business "Convert File". I have the HTMLs all...
Read more >
Traversing an HTML table with JavaScript and DOM Interfaces
First we created the <table> element. · Next, we created the <tbody> element, which is a child of the <table> element. · Next,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found