漫漫技术人生路

C#

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TEST.aspx.cs" Inherits="TEST" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <script language="javascript" type="text/javascript">
    <!--
      function round(radius)
      {
        this.radius=radius;
        this.piValue=Math.PI;
        this.showarea=showarea;
      }
     
      function showarea()
      {
        var hArea=this.piValue*this.radius
        return hArea;
      }
   
     function operation(object)
     {
        myRound=new round(10);
        document.write("circle area:"+myRound.showarea());
     }
    
     function promptEXM()
     {
        var answer=prompt("input your name?","");
        if(answer)
        {
            document.write(answer+"welcome to this website");
        }
     }
    
    function setn()
     {
        for(var i=0;i<document.form1.elements.length;i++)
        {
            if(document.form1.elements[i].type=="text")
            {
                document.form1.elements[i].value="";
              
            }
           
             if(document.form1.elements[i].item=="p")
            {
                document.form1.elements[i].value="";
                alert("true");
            }
        }
      //  document.form1.pwd.onfocus()
     }
    
     //var form=window.document.forms[0];
   //  document.form1.action="http://www.baidu.com";
  // form.action="http://www.baidu.com";
   
   // window.onload=function dd{alert("trueee");}
   
    function getRaName()
    {
     var form=document.form1;
     for(var i=0;i<document.form1.gprd.length;i++)
     {
        if(document.form1.gprd[i].checked)
        {
            break;
        }
     }
    
     document.write(form.gprd[i].value);
    }
   
    function goThere(form)
    {
        var list=form.urlList;
        location.href=list.options[list.selectedIndex].value;
    }
   
    function checkForm(form)
    {
        for(var i=0;i<form.elements.length;i++)
        {
            if(form.elements[i].type=="text")
            {
                if(form.elements[i].value=="")
                {
                    alert("not allow null");
                    return false;//protect from entrying into dead circle
                }
            }
        }
    }
   
   
    var imageLibrary=new Array();
    imageLibrary["image1"]=new Image(120,90);
    imageLibrary["image1"].src="Prod_Images/Backyard/icon-cat.gif";
    imageLibrary["image2"]=new Image(120,90);
    imageLibrary["image2"].src="Prod_Images/Backyard/icon-crab.gif";
    imageLibrary["image3"]=new Image(120,90);
    imageLibrary["image3"].src="Prod_Images/Backyard/icon-goose.gif";
   
    function loadCached(list)
    {
        var img=list.options[list.selectedIndex].value;
      //  document.form1.fristly.src=img;
      document.form1.fristly.src=imageLibrary[img].src;
       
    }
   
   
   
   
    //-->
    </script>
</head>
<body onload="setn();">
    <form id="form1" runat="server" onsubmit="checkForm(this)">
    <div>
    <p onclick="operation(this)">这是一个对象</p>
   
     <p onclick="promptEXM()">this is a programm used to test prompt</p>
    
     <input type="text" value="fasfasfd" id="texdt" />
     <p onclick ="getRaName()">test radio within group
     <input type="radio" name="gprd" value="1" />
      <input type="radio" name="gprd" value="2" />
       <input type="radio" name="gprd" value="3" />
        <input type="radio" name="gprd" value="4" />
        </p>
       
        <span>
        <select name="urlList" onchange="goThere(this.form)">
        <optgroup label="dd">
        <option selected="selected" value="index.htm">主页</option>
        <option value="http://www.google.com" title="f">google</option>
        </optgroup>
        </select>
        </span>
       
        <table>
            <tr>
                <td style="width: 298px">
                </td>
                <td style="width: 326px">
                    <input id="id" type="text" /></td>
                <td style="width: 354px">
                </td>
            </tr>
            <tr>
                <td style="width: 298px">
                </td>
                <td style="width: 326px">
                    <input id="pwd" type="text" /></td>
                <td style="width: 354px">
                </td>
            </tr>
            <tr>
                <td style="width: 298px">
                </td>
                <td style="width: 326px">
                    <input id="name" type="text" /></td>
                <td style="width: 354px">
                </td>
            </tr>
            <tr>
                <td style="width: 298px; height: 21px">
                </td>
                <td style="width: 326px; height: 21px">
                    <input id="Submit1" type="submit" value="submit" /></td>
                <td style="width: 354px; height: 21px">
                </td>
            </tr>
        </table>
       
       
       
    </div>
   
    <div> pre-Cache image
    <img src="Prod_Images/Backyard/icon-sheep.gif" id="fristly" width="90px" height="120px" alt="pre-Cache image" />
    <select name="cached" onchange="loadCached(this)">
    <option value="image1">one</option>
    <option value="image2">two</option>
    <option value="image3">three</option>
    </select> </div>
   
  
    </form>
</body>
</html>

posted on 2006-11-02 15:31  javaca88  阅读(380)  评论(0)    收藏  举报