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
    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. Feb 12, 2017 at 10:43

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

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

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