Wikipedia

2014年4月28日 星期一

lab20

(Common Gateway Interface/CGI)是一種重要的網際網路技術,可以讓一個客戶端,從網頁瀏覽器向執行在網路伺服器上的程序請求數據。CGI描述了客戶端和伺服器程序之間傳輸數據的一種標準。



   
<html>
<body>


<form name="search" action="http://maps.google.com/maps" method="get"    onsubmit="return check()">
search:<input type="text" name="q"  value=""><br>
<input type="submit" value="search"id="exampleForm">

<script>


function check(){
  var floatReg = /^[-|+]*[\d]*[.|\d][\d]*[,][-|+]*[\d]*[.|\d][\d]*$/;

  if(!floatReg.test(search.q.value)){
  alert("錯誤");
  search.q.value="";
  document .search.q.focus();
 
  return false;
 }
}
  </script>

</body>
</html> 
search:

沒有留言:

張貼留言