-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
98 changed files
with
4,767 additions
and
5,078 deletions.
There are no files selected for viewing
38 changes: 18 additions & 20 deletions
38
docs/content/learning-area/html/forms/html-form-structure/required-labels.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Required label examples</title> | ||
</head> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Required label examples</title> | ||
</head> | ||
<body> | ||
<form> | ||
<p>Required fields are followed by <abbr title="required">*</abbr>.</p> | ||
|
||
<body> | ||
<form> | ||
<p>Required fields are followed by <abbr title="required">*</abbr>.</p> | ||
|
||
<!-- So this: --> | ||
<!--<div> | ||
<!-- So this: --> | ||
<!--<div> | ||
<label for="username">Name:</label> | ||
<input type="text" name="username"> | ||
<label for="username"><abbr title="required">*</abbr></label> | ||
</div>--> | ||
|
||
<!-- would be better done like this: --> | ||
<!--<div> | ||
<!-- would be better done like this: --> | ||
<!--<div> | ||
<label for="username"> | ||
<span>Name:</span> | ||
<input id="username" type="text" name="username"> | ||
<abbr title="required">*</abbr> | ||
</label> | ||
</div>--> | ||
|
||
<!-- But this is probably best: --> | ||
<div> | ||
<label for="username">Name: <abbr title="required">*</abbr></label> | ||
<input id="username" type="text" name="username" /> | ||
</div> | ||
</form> | ||
</body> | ||
|
||
<!-- But this is probably best: --> | ||
<div> | ||
<label for="username">Name: <abbr title="required">*</abbr></label> | ||
<input id="username" type="text" name="username" /> | ||
</div> | ||
</form> | ||
</body> | ||
</html> |
65 changes: 31 additions & 34 deletions
65
docs/content/learning-area/html/forms/image-type-example/index.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title><input type="image"> example</title> | ||
<style> | ||
div { | ||
margin-bottom: 10px; | ||
} | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title><input type="image"> example</title> | ||
<style> | ||
div { | ||
margin-bottom: 10px; | ||
} | ||
|
||
label { | ||
display: inline-block; | ||
width: 70px; | ||
text-align: right; | ||
padding-right: 10px; | ||
} | ||
|
||
</style> | ||
</head> | ||
|
||
<body> | ||
<form> | ||
<p>Login to your account</p> | ||
<div> | ||
<label for="userId">User ID</label> | ||
<input type="text" id="userId" name="userId" /> | ||
</div> | ||
<div> | ||
<label for="pwd">Password</label> | ||
<input type="password" id="pwd" name="pwd" /> | ||
</div> | ||
<div> | ||
<input id="image" type="image" src="login.png" alt="login button" width="100" /> | ||
</div> | ||
</form> | ||
</body> | ||
label { | ||
display: inline-block; | ||
width: 70px; | ||
text-align: right; | ||
padding-right: 10px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<form> | ||
<p>Login to your account</p> | ||
<div> | ||
<label for="userId">User ID</label> | ||
<input type="text" id="userId" name="userId" /> | ||
</div> | ||
<div> | ||
<label for="pwd">Password</label> | ||
<input type="password" id="pwd" name="pwd" /> | ||
</div> | ||
<div> | ||
<input id="image" type="image" src="login.png" alt="login button" width="100" /> | ||
</div> | ||
</form> | ||
</body> | ||
</html> |
49 changes: 23 additions & 26 deletions
49
docs/content/learning-area/html/forms/image-type-example/xy-coordinates-example.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>X Y coordinates example</title> | ||
<style> | ||
div { | ||
margin-bottom: 10px; | ||
} | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>X Y coordinates example</title> | ||
<style> | ||
div { | ||
margin-bottom: 10px; | ||
} | ||
|
||
label { | ||
display: inline-block; | ||
width: 70px; | ||
text-align: right; | ||
padding-right: 10px; | ||
} | ||
|
||
</style> | ||
</head> | ||
|
||
<body> | ||
<form> | ||
<p>Choose your favourite color</p> | ||
<div> | ||
<input id="image" type="image" src="colors.png" alt="image of four colored squares" /> | ||
</div> | ||
</form> | ||
</body> | ||
label { | ||
display: inline-block; | ||
width: 70px; | ||
text-align: right; | ||
padding-right: 10px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<form> | ||
<p>Choose your favourite color</p> | ||
<div> | ||
<input id="image" type="image" src="colors.png" alt="image of four colored squares" /> | ||
</div> | ||
</form> | ||
</body> | ||
</html> |
117 changes: 57 additions & 60 deletions
117
docs/content/learning-area/html/forms/indeterminate-example/index.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>callback test</title> | ||
</head> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>callback test</title> | ||
</head> | ||
<body> | ||
<form> | ||
<fieldset> | ||
<legend>Complete the recipe</legend> | ||
<div> | ||
<input type="checkbox" id="EnchTbl" name="EnchTbl" /> | ||
<label for="EnchTbl">Enchantment table</label> | ||
<ul> | ||
<li> | ||
<input type="checkbox" id="book" name="ingredient" value="book" /> | ||
<label for="book">Book</label> | ||
</li> | ||
<li> | ||
<input type="checkbox" id="diamonds" name="ingredient" value="diamonds" /> | ||
<label for="diamonds">Diamonds (x2)</label> | ||
</li> | ||
<li> | ||
<input type="checkbox" id="obsidian" name="ingredient" value="obsidian" /> | ||
<label for="obsidian">Obsidian (x4)</label> | ||
</li> | ||
</ul> | ||
</div> | ||
</fieldset> | ||
</form> | ||
<script> | ||
var overall = document.querySelector('input[id="EnchTbl"]'); | ||
var ingredients = document.querySelectorAll('ul input'); | ||
|
||
<body> | ||
<form> | ||
<fieldset> | ||
<legend>Complete the recipe</legend> | ||
<div> | ||
<input type="checkbox" id="EnchTbl" name="EnchTbl" /> | ||
<label for="EnchTbl">Enchantment table</label> | ||
<ul> | ||
<li> | ||
<input type="checkbox" id="book" name="ingredient" value="book" /> | ||
<label for="book">Book</label> | ||
</li> | ||
<li> | ||
<input type="checkbox" id="diamonds" name="ingredient" value="diamonds" /> | ||
<label for="diamonds">Diamonds (x2)</label> | ||
</li> | ||
<li> | ||
<input type="checkbox" id="obsidian" name="ingredient" value="obsidian" /> | ||
<label for="obsidian">Obsidian (x4)</label> | ||
</li> | ||
</ul> | ||
</div> | ||
</fieldset> | ||
</form> | ||
<script> | ||
var overall = document.querySelector( 'input[id="EnchTbl"]' ); | ||
var ingredients = document.querySelectorAll( 'ul input' ); | ||
overall.addEventListener('click', function (e) { | ||
e.preventDefault(); | ||
}); | ||
|
||
overall.addEventListener( 'click', function ( e ) { | ||
e.preventDefault(); | ||
} ); | ||
for (var i = 0; i < ingredients.length; i++) { | ||
ingredients[i].addEventListener('click', updateDisplay); | ||
} | ||
|
||
for ( var i = 0; i < ingredients.length; i++ ) { | ||
ingredients[ i ].addEventListener( 'click', updateDisplay ); | ||
} | ||
|
||
function updateDisplay() { | ||
var checkedCount = 0; | ||
for ( var i = 0; i < ingredients.length; i++ ) { | ||
if ( ingredients[ i ].checked ) { | ||
checkedCount++; | ||
} | ||
} | ||
|
||
if ( checkedCount === 0 ) { | ||
overall.checked = false; | ||
overall.indeterminate = false; | ||
} else if ( checkedCount === ingredients.length ) { | ||
overall.checked = true; | ||
overall.indeterminate = false; | ||
} else { | ||
overall.checked = false; | ||
overall.indeterminate = true; | ||
} | ||
} | ||
|
||
</script> | ||
</body> | ||
function updateDisplay() { | ||
var checkedCount = 0; | ||
for (var i = 0; i < ingredients.length; i++) { | ||
if (ingredients[i].checked) { | ||
checkedCount++; | ||
} | ||
} | ||
|
||
if (checkedCount === 0) { | ||
overall.checked = false; | ||
overall.indeterminate = false; | ||
} else if (checkedCount === ingredients.length) { | ||
overall.checked = true; | ||
overall.indeterminate = false; | ||
} else { | ||
overall.checked = false; | ||
overall.indeterminate = true; | ||
} | ||
} | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.