Skip to content Skip to sidebar Skip to footer

How To Show Hidden Data Types In Php Loop?

Is there a way to toggle show/hide for data that is dynamically populated in a php loop? I've been around and around trying to figure out the best way to do this, but I just don't

Solution 1:

Something like this? demo

 example:<br />
    <button onClick="$('.hide').toggle();">click me</button>
    <table>
         <tr style="display:none;" class="hide">
            <td colspan="3">abstract text</td>
         </tr>

         <tr style="display:none;" class="hide">
           <td colspan="3">
              <form action="assign_session.php" method="post" id="form">
                <label for="abstract_category">Assign Session:</label>
                <input type="hidden" name="abstract_id" value="'. $row['abstract_id'] .'" />
                <input type="radio" name="abstract_category" value="session1" />Session One
                <input type="radio" name="abstract_category" value="session2" />Session Two
                <input type="radio" name="abstract_category" value="notapplicable" />Not Applicable             
                 <button type="submit" formaction="assign_session.php">Assign</button></label>
             </form>
        </td>
      </tr>
    </table>

I use jquery to toggle (show/hide) the elements you need to show/hide.

Moreover you have several errors on this code (like you are not closing the first td, not using in the right way labels).


Solution 2:

You can use jquery to do something like this

Let's say you click Show

$('#my_button').click(function(){
                      $('#hidden_div').val('hidden',false);});

or for CSS

$('#my_button').click(function(){
                      $('#hidden_div').css('display','all');});

Post a Comment for "How To Show Hidden Data Types In Php Loop?"