http://members.aol.com/grassblad/html/valText1.html





/* -------------------------------
author: Vincent Puglia, GrassBlade Software
site: http://members.aol.com/grassblad
----------------------------- */

// the HTML code for the javascript version





// the javascript function
function validIt(fldObj)
{
var fldVal = fldObj.value;

if ( ( fldVal == '') || (fldVal == 'Email address') )
{
alert('You must fill in the field')
fldObj.focus()
fldObj.select();
}
else
fldObj.value = 'http://' + fldVal;
}


// the code for the HTML version

onBlur="javascript:value =
((value == '') || (value=='Enter data')) ?
'Enter data' : 'http://' + value;
if(value=='Enter data'){ this.focus(); this.select()}">



創作者介紹

創造心理的感動

gisanfu 發表在 痞客邦 PIXNET 留言(0) 人氣()