Html button value

hello guys, a little problem. How to make button’s name " X " or “Delete” but the form must send $new_row as it’s action. The problem is when I change the value to “Delete” or “X” it doesn’t work and I need button exactly to be “Delete” or “X”

echo "<tr>";
	echo "<form action='../admin/dcodes_action.php' id='form' method='post'>";
	echo "<td>";
		
		echo "<input class='delete_button' name='todelete' type='submit' 
value='$new_row' onClick='window.location.reload()'><strong> - ".$new_row."</strong>";
	echo "</td>";
	echo "</form>";
	echo "</tr>";

You’ll want to use a button element for the button . You can use a hidden input to store the data you want to send.

<form action='../admin/dcodes_action.php' id='form' method='post'>
    <input type="hidden" name="todelete" value='$new_row'>
    <button type="submit">Delete</button>
</form>
2 Likes

Thank you so much for help :slight_smile: