Posted by on | |
function myclass()
{
this.name = "onnie" ;
this.birtyday = "19001203";
this.obj1 ;
this.obj2 ;
this.obj3 ;

this.printname = function callme()
{
alert(this.name);
alert(this.birtyday);
alert(this.obj1.value)
alert(this.obj2.value)
alert(this.obj3.value)
}



}


function checkname(t)
{
if (t.obj1.value == "" )
{
alert("請檢查dd!!");
}

if (t.obj2.value == "" )
{
alert("請檢查ss!!");
}

if (t.obj3.value == "" )
{
alert("請檢查ff!!");
}
}


========================


function doit()
{
var t1 = new myclass ;
t1.name = "haha";
t1.obj1 = document.form1.dd ;
t1.obj2 = document.form1.ss ;
t1.obj3 = document.form1.ff ;

//t1.printname();

checkname(t1);

}

0 意見: