I don't know what you are trying to achieve but here is the working example: This will print the value you have submitted in your PHP file. Also try to use jquery instead.
<form action="formaction.php" id="form">
<table>
<tr>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Radiography (RT)" /></td>
<td style="padding-left:4px;">Radiography (RT)</td>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Ultrasonic (UT)" /></td>
<td style="padding-left:4px;">Ultrasonic (UT)</td>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Liquid Penetrant (PT)" /></td>
<td style="padding-left:4px;">Liquid Penetrant (PT)</td>
</tr>
<tr>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Magnetic Particle (MT)" /></td>
<td style="padding-left:4px;">Magnetic Particle (MT)</td>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Visual (VT)" /></td>
<td valign="middle">Visual (VT)</td>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Leak (LT)" /></td>
<td style="padding-left:4px;">Leak (LT)</td>
</tr>
<tr>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Eddy Current (EC)" /></td>
<td style="padding-left:4px;">Eddy Current (EC)</td>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Infrared & Thermography (I&T)" /></td>
<td style="padding-left:4px;">Infrared & Thermography (I&T)</td>
<td style="padding-left:4px;"><input style="margin-top:0px; cursor:pointer;" type="checkbox" name="afchek[]" value=" Acoustic Emission (AE)" /></td>
<td style="padding-left:4px;">Acoustic Emission (AE)</td>
</tr>
<tr>
<td><input type="submit" name="submit" value="submit"></td>
</tr>
</table>
</form>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="main.js"></script>
Here is how you submit the form and it will alert the value you have submitted.
$(document).ready(function(){
$("#form").on("submit",function(event){
event.preventDefault();
postdata = $('#form').serialize();
$.ajax({
type: 'POST',
url: 'formaction.php',
data: postdata,
success: function(res){
alert(res);
}
});
});
});
Here is your PHP file: Which return whatever has been submitted through the form and alert it alert on success of your ajax request.
<?php
//formaction.php
$afname=$_POST["afchek"];
foreach ($afname as $key => $afname) {
echo ucfirst($afname);
}
?>
Now you can use this value the way you want.
Demo link: http://dharmeshpatel.net/core_reporting_api/test.php
Hope that helps. Not exactly the way you wanted but you will get an idea.