• I trying to create my own customized plugin, i am so close to finish it but I encounter this problem that I can’t solve. I need to insert a submit button in a table that in the wp backend setting page.

    the codes would be like this:

    <?php
    if(is_array($idea))
    {
    	?>
    
    	<?php echo '<table class="wide">'; ?>
       <?php  echo '<thead> <tr>
    			<th>Id</th>
    			<th>Title</th>
    			<th>Price</th>
    			<th>Contry</th>
    			<th>Location</th>
    			<th>Action</th>
    			</tr></thead> <tfoot> <tr>
    			<th>Id</th>
    			<th>Title</th>
    			<th>Price</th>
    			<th>Contry</th>
    			<th>Location</th>
    			<th>Action</th></tfoot>'; ?>
    
        <?php foreach($idea as $chec)
    		{ 
    
             echo '<tbody><tr>';
             echo '<td>'.$chec['id'].'</td>';
    	 echo '<td>'.$chec['fact'].'</td>';
             echo '<td>'.$chec['comment'].'</td>';
             echo '<td>'.$chec['source'].'</td>';
             echo '<td>'.$chec['source'].'</td>';
    
    /*here is where i need to insert a input button*/
           echo "<form method='post' action='<?php action_url ?>'";
           echo "<input type='hidden' name='Template_Id' value=' <?php echo $chec['id'];?>'>";
            echo '<td>';
             echo '<input class='button' type='submit' name='Submit' value="<?php _e('Delete', 'Template');?>"> </form>';
             echo'</td>';
    
    	echo '<tbody><tr>';
    
            } 
    
    	echo '</table>'; ?>
    
    <?php
    }
    ?>

    The problem is, how to I add the input form into the <td></td> area? I tried many way but always return me a phrase error. thanks

  • The topic ‘How to add form input in a table?’ is closed to new replies.