How to maintain PHP checkbox data?

Asked

Viewed 80 times

1

as I leave permanently saved at checkbox

----\

<!DOCTYPE html>
<html>
<body>

<form action="">
<input type="checkbox" name="box" value="Bike">Pago<br>
<input type="checkbox" name="box" value="Car">Nao Pago 
</form>

</body>
</html>

  • Puts checked="checked" in the input

  • Thank you very much, but would you be able to save the selected option, so that someone else can view ? or I have to connect to the database and then pull that data to the page.

1 answer

0

Just add the attribute checked input in this way is already marked when the page opens.

Recommended reading:

MDN - checkbox

Browser other questions tagged

You are not signed in. Login or sign up in order to post.