Html button value

Html button value
0

#1

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>";

#2

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>

#3

Thank you so much for help :slight_smile: