Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html lang="en"> <head> <title>W3docs Example</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> <style> .gfg { font-size: 40px; font-weight: bold; color: green; } body { text-align: center; } </style> </head> <body> <?php if(isset($_GET['submit'])) { $var = isset($_GET['option1']); if($var) { echo "Option 1 submitted successfully"; } } ?> <div class="container"> <div class="gfg">W3docs</div> <h2>Form control: checkbox</h2> <p>The form below contains one checkbox.</p> <form method="get" action="/form/submit"> <div class="checkbox"> <label> <input type="checkbox" name="option1" value="Option 1" />Option 1 </label> <button name="submit" value="true">SUBMIT</button> </div> </form> </div> </body> </html>