Last active
August 29, 2015 14:21
-
-
Save vutranvn/51b71cad436d97b096e2 to your computer and use it in GitHub Desktop.
Test Option Group Select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Demo nyro Modal</title> | |
<link rel="stylesheet" href="css/nyroModal.css" type="text/css" media="screen"> | |
<script src="//code.jquery.com/jquery-1.7.min.js"></script> | |
<script type="text/javascript" src="js/jquery.nyroModal.js"></script> | |
<script type="text/javascript" src="js/jquery.nyroModal-ie6.js"></script> | |
</head> | |
<body> | |
<?php | |
if(isset($_POST['sbmt']) && $_POST['sbmt'] == "Submit"){ | |
var_dump($_POST); | |
} | |
?> | |
<form action="" method="post" accept-charset="utf-8"> | |
<select name="testSelect"> | |
<optgroup label="Swedish Cars"> | |
<option value="volvo" <?php echo (isset($_POST['testSelect']) && $_POST['testSelect'] == 'volvo') ? 'selected' : ''; ?>>Volvo</option> | |
<option value="saab" <?php echo (isset($_POST['testSelect']) && $_POST['testSelect'] == 'saab') ? 'selected' : ''; ?>>Saab</option> | |
</optgroup> | |
<optgroup label="German Cars"> | |
<option value="mercedes" <?php echo (isset($_POST['testSelect']) && $_POST['testSelect'] == 'mercedes') ? 'selected' : ''; ?> >Mercedes</option> | |
<option value="audi" <?php echo (isset($_POST['testSelect']) && $_POST['testSelect'] == 'audi') ? 'selected' : ''; ?>>Audi</option> | |
</optgroup> | |
</select> | |
<input type="submit" name="sbmt" value="Submit"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment