0

Are we able to get the value of the name inside the <td>?

Code

<form action='' method='post'>
<table>
<tr>
<td name='read_recordid'>VALUE</td>
</tr>
</table>
</form>

Using post to get the value

if ($_POST['read_recordid']) {
//do something

}

1
  • 1
    Submitting a form only submits certain fields (namely input, select, textarea and button). Table data cells are not submitted.
    – apokryfos
    Commented Feb 12, 2017 at 7:46

2 Answers 2

4

Use

 <input type="hidden" name="read_recordid" value=""/> 

or Use id in

 <td id="id_name"> </td> 

acess this id using Javascript and post to php code.

<script type="text/javascript">
 var x=  document.getElementById("id_name"').value;
</script>
2

No, you can't. We have to use input, select and etc. Might be you are finding something like

<input type="hidden" name="read_recordid" value="VALUE"/>
1
  • You can use either input, select, textarea or button. Commented Feb 12, 2017 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.