forked from minkphp/Mink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request minkphp#518 from aik099/495-single-change-event-ve…
…rification Adding test for `change` event fire count verification
- Loading branch information
Showing
2 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
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
60 changes: 60 additions & 0 deletions
60
tests/Behat/Mink/Driver/web-fixtures/element_change_detector.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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"> | ||
<head> | ||
<title>ADvanced Form</title> | ||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> | ||
<script src="js/jquery-1.6.2-min.js"></script> | ||
</head> | ||
<body> | ||
<h1>ADvanced Form Page</h1> | ||
|
||
<form method="POST" enctype="multipart/form-data" action="advanced_form_post.php"> | ||
<input id="the-input-default" value="" /> | ||
<input type="text" id="the-input-text" value="" /> | ||
<input type="email" id="the-email" value="" /> | ||
|
||
<select id="the-select"> | ||
<option value="10">ten</option> | ||
<option selected="selected" value="20">twenty</option> | ||
<option value="30">thirty</option> | ||
</select> | ||
|
||
<label for="sex"> | ||
<span><input type="radio" name="sex" id="the-radio-m" value="m" /> m</span> | ||
<span><input type="radio" name="sex" id="the-radio-w" value="w" checked="checked" /> w</span> | ||
</label> | ||
|
||
<input type="checkbox" id="the-checked-checkbox" value="cb-val" checked/> | ||
<input type="checkbox" id="the-unchecked-checkbox" value="cb-val"/> | ||
|
||
<textarea id="the-textarea">original notes</textarea> | ||
|
||
<input type="file" id="the-file" /> | ||
</form> | ||
|
||
<ul id="results" style="border: 1px solid red;"> | ||
<li>for easy element location</li> | ||
</ul> | ||
|
||
<script type="text/javascript"> | ||
$(document).ready(function () { | ||
var $change_registry = {}, | ||
$results = $('#results'); | ||
|
||
$(':input').change(function ($e) { | ||
var $result_id = this.id + '-result'; | ||
|
||
if (!$change_registry[this.id]) { | ||
$change_registry[this.id] = 1; | ||
$results.append('<li id="' + $result_id + '"></li>'); | ||
} | ||
else { | ||
$change_registry[this.id]++; | ||
} | ||
|
||
$('#' + $result_id).text($change_registry[this.id]); | ||
}) | ||
}); | ||
</script> | ||
</body> | ||
</html> |