multiple checkbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crisis123
    New Member
    • Jun 2009
    • 18

    #31
    Code:
    <html>
    <head><title>Mainpage</title></head>
    <body>
    <table border = "1">
    <th>S.No.</th>
    <th>Select row</th>
    <th>Consultant Name</th>
    <th>Consultant Location</th>
    <th>Consultant Job Title</th>
    <th>Consultant SKILLS</th>
    <th>Consultant Summary</th>
    <th>Consultant Rate</th>
    <th>Consultant Relocate</th>
    <th>Consultant Last Assignment Date</th>
    <th>Consultant Resume</th>
    <?php
    $file = fopen("users.txt", "r") or exit("Unable to open file!");
    for($i=1; $i<=10; $i++)
    {
    ?>
    <tr><td><?echo $i?></td>
    <td>
    <input type="radio" name="select" value="<?echo $i;?>"/>
    <?
    	echo "</td>";
    	for($j=1; $j<=9; $j++)
    	{
    		$test = fgets($file);
    		echo "<td>";
    		echo "$test";
    		echo "</td>";
    	}
    		echo "</tr>";
    }
    fclose($file);
    ?>
    </table>
    <a href="form.php"><font size="2">Add</font></a>
    <form action="mainpage.php" name="form"<?echo $i?> method="post">
    <input type="hidden" name="variablename" value=".$i."/>
    <input type="submit" value="Delete"/>
    </form>
    </body>
    </html>
    this is the code i have used for creating a html table
    however on clicking the delete button the selected row is not deleted
    any suggestions??
    Last edited by Markus; Jun 24 '09, 09:46 AM. Reason: Added [code] tags

    Comment

    • monsto
      New Member
      • Mar 2010
      • 1

      #32
      Hello,

      Could somebody direct me to right direction. I want to make order form from checkboxes and radio buttons, I made working code for it, but I dont know how to make a calculation script for price. Because checkboxes or radio buttons has one value ( <input type="checkbox" name="papildoma[]" value="Order 1">, <input type="checkbox" name="papildoma[]" value="Order 2">), but how to point for these values price what could be calculated in total price?

      Comment

      • arvind vohra
        New Member
        • Jan 2012
        • 12

        #33
        1 <input type="checkbox" name="checkbox1 " value="1" />
        2 <input type="checkbox" name="checkbox" value="2" />

        Comment

        • ikhwan anshori
          New Member
          • May 2013
          • 2

          #34
          multiple select with checkbox

          Code:
          <form action="checkbox.php" method="post">
            <input type="checkbox" name="checkbox" value="a">
            <input type="checkbox" name="checkbox" value="b">
            <input type="checkbox" name="checkbox" value="c">
            <input type="checkbox" name="checkbox" value="d">
            <br>
            <br>
            <input type="submit" name="Submit" value="Submit">
          </form>
          checkbox.php
          Code:
          <?php
          $submit = $_POST['submit'];
          $checkbox = $_POST['checkbox'];
          if(isset($submit)){
          $check = count($checkbox);
          for($x=0;$x<$check;$x++){
          echo"$checkbox[$x]<br/>";
          }
          }
          ?>
          out put :
          a
          b
          c
          d
          Last edited by Dormilich; May 18 '13, 09:45 AM.

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #35
            looks correct, so far.

            Comment

            • noyon
              New Member
              • May 2013
              • 1

              #36
              checkbok is database connect

              Comment

              Working...