Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the service type and operations select box.
- Loading branch information
Showing
4 changed files
with
106 additions
and
18 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
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
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,40 @@ | ||
<html> | ||
<head> | ||
<script type="text/javascript" src="jquery-1.7.2.min.js"></script> | ||
</head> | ||
<body> | ||
test | ||
<select name="services" id="services"> | ||
<option value="1">Service Type1</option> | ||
</select> | ||
|
||
<select name="operations" id="operations"> | ||
<option value="2">Operation Type1 </option> | ||
</select> | ||
<script type="text/javascript"> | ||
function getDateTime(theDate) { | ||
return theDate.getFullYear() + "-" + (theDate.getMonth() +1) + "-" + theDate.getDate() + " " + theDate.getHours() | ||
+ ":" + theDate.getMinutes() + ":" + theDate.getSeconds(); | ||
} | ||
|
||
function receiveOnChange(data){ | ||
window.alert(data[0].serviceType); | ||
} | ||
|
||
function run() { | ||
var data = [{"serviceType": "service type 1", "operations":"this is the operation 1"}, {"serviceType":"service type 2", "operations": "This is the operation 2"}]; | ||
|
||
var thesvc = $("#services"); | ||
thesvc.empty(); | ||
$.each(data, function(key, value){ | ||
thesvc.append($("<option></option>").attr("value", data[key].serviceType).text(data[key].serviceType)); | ||
}); | ||
thesvc.on('change', function(){ | ||
receiveOnChange(data); | ||
}); | ||
} | ||
|
||
run(); | ||
</script> | ||
</body> | ||
</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