2013年10月28日 星期一

Lab 18

<html>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/"  name="q" method="get" id="exampleForm" onsubmit="return check()">
search:<input type="text" id="examplePass" name="q" >
<input type="submit" value="submit">
<br>
</form>
</body>
<script>
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex =/\-?\d+(\.\d+)?\,\-?\d+(\.\d+)?$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
return false;
var notify = document.getElementById("notify");
if(notify === null){
notify = document.createElement("p");
notify.textContent = "ERROR";
notify.id ="notify";
var body =document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html>

Lab 17

<html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
<input type="text" id="examplePass"/>
<input type="submit" />
</form>
</body>
<script>
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex =/-?\d+(\.\d+)?\,\-?\d+(\.\d+)?$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
var notify = document.getElementById("notify");
if(notify === null){
notify = document.createElement("p");
notify.textContent = "ERROR";
notify.id ="notify";
var body =document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html>

Lab 16

<html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
<input type="text" id="examplePass"/>
<input type="submit" />
</form>
</body>
<script>
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex =/-?\d+(\.\d+)?$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
var notify = document.getElementById("notify");
if(notify === null){
notify = document.createElement("p");
notify.textContent = "ERROR";
notify.id ="notify";
var body =document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html>

2013年10月21日 星期一

Lab 15

<html>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/"  name="q" method="get" id="exampleform">
search:<input type="text" name="q" id="examplePass">
<input type="submit" value="submit">
<br>
</form>
</body>
</html>


Lab 14

1.
<html>
<head>
</head>
<body id="body">
<form action="http://www.google.com.tw/search" id="exampleForm" name="q" method="get">
<input type="text" name="q" id="examplePass" />
<input type="submit" />
</form>
</body>

2.<html>
<head>
</head>
<body>
<form action="http://www.google.com.tw/search"  name="q" method="post">
search:<input type="text" name="q">
<input type="submit" value="submit">
<br>
</form>
</body>
</html>



Lab 13

<html>
<body>

<img onmouseover="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZj6Kp_iPNEVB58Ppb45-xkH9sc3XlpPPaF-bGcBQyr-aMaiXidZ8EqVob76tV93L4YspRKOaheBB33ytJa3DIeViJLp2eq98frp5qX8Cbq-xqToA-ax8pCshXPn60GmmDIS_k4p1II8/s320/DSC_1795.JPG'" onmouseout="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78aVAdTEK9cDKbPHhtAAp5m8Tu1kLUPNs4Pb0hxoNwxXgROU8UkiNLFYpF61_LtQ6mwQfkpPclFqZ1d82T1UepzHGo2BPMBdZs4nWBHMuhUGbD1oA_S5qWDK7vnx1MCUszNB2quZKG25T/s320/DSC_1772.JPG'" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZj6Kp_iPNEVB58Ppb45-xkH9sc3XlpPPaF-bGcBQyr-aMaiXidZ8EqVob76tV93L4YspRKOaheBB33ytJa3DIeViJLp2eq98frp5qX8Cbq-xqToA-ax8pCshXPn60GmmDIS_k4p1II8/s320/DSC_1795.JPG"</img>



</body>
</html>


HW 10-14

1
2
3
http://3205.tw.tranews.com/Show/images/Column/13609_2.jpg 3205.tw.tranews.com