kalil
kalil

Reputation: 21

Change display text from a html button from its "value"

Im trying to created a button with the text "Delete" write on them. when this button is clicked it will export some values with the method GET. but because of this the "value" of the button displays the values that will be exported instead the word "Delete how can i change this?

<form action="usuario.php" method="get">
  <input type="submit" name="mesa" class="success button" value="<?php echo 
  $row['mesa'];?>"/>
</form>

Upvotes: 0

Views: 2095

Answers (2)

PHPnoob
PHPnoob

Reputation: 614

Use another input with hidden attribute to send your values :

<input type="hidden" name="mesa" value="<?php echo $row['mesa'];?>">

And set submit button's value to the label you want for it :

<input type="submit" name="submit_button" class="success button" value="Delete">

Upvotes: -1

Quentin
Quentin

Reputation: 943579

Use a button element instead of an input element.

<button name="name" value="value submitted when clicked">Display Text</button>

Upvotes: 3

Related Questions