|
|
|
text box แบบใส่รูปได้ คือต้องการพิมพ์แล้วให้รูปหาย |
|
|
|
|
|
|
|
แบบนี้ ก็ได้
Code (PHP)
<?php
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Marosdee" />
<style type="text/css">
<!--
.tb-bg-image
{
background-color: #CCFFFF;
background-image: url(bg.png);
border: 1px solid #6297BC;
}
.tb-bg-image-none
{
background: none;
border: 1px solid #6297BC;
}
-->
</style>
<title>Untitled 4</title>
</head>
<body>
<input type="text" name="textfield" id="textfield" class="tb-bg-image" onfocus="this.setAttribute('class', 'tb-bg-image-none');" onblur="if (this.value == '') this.setAttribute('class', 'tb-bg-image');else this.setAttribute('class', 'tb-bg-image-none');" />
</body>
</html>
?>
เออ
ผมลองกับ IE 6 มันไม่รองรับแฮะ
งงเหมือนกัน
|
|
|
|
|
Date :
2009-05-19 15:53:59 |
By :
danya |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณน่ะครับ
|
|
|
|
|
Date :
2009-05-19 16:01:17 |
By :
wiroon152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอาใหม่ๆ อันนี้ รองรับ IE ด้วย
ไปมั่วมา 555+
Code (PHP)
<?php
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Marosdee" />
<script type="text/javascript">
function getUserAgent()
{
if ( navigator.userAgent.indexOf('IE')!= -1 )
return true;
else
return false;
}
window.onload = function()
{
var IE = getUserAgent();
document.getElementById('textfield').onfocus = function()
{
if (IE)
this.setAttribute('className', 'tb-bg-image-none');
else
this.setAttribute('class', 'tb-bg-image-none');
//this.style.className = 'tb-bg-image-none';
}
document.getElementById('textfield').onblur = function()
{
if (this.value == '')
if (IE)
this.setAttribute('className', 'tb-bg-image');
else
this.setAttribute('class', 'tb-bg-image');
else
if (IE)
this.setAttribute('className', 'tb-bg-image-none');
else
this.setAttribute('class', 'tb-bg-image-none');
}
}
</script>
<style type="text/css">
<!--
.tb-bg-image
{
background-color: #CCFFFF;
background-image: url(bg.png);
border: 1px solid #6297BC;
}
.tb-bg-image-none
{
background: none;
border: 1px solid #6297BC;
}
-->
</style>
<title>Untitled 4</title>
</head>
<body>
<input type="text" name="textfield" id="textfield" class="tb-bg-image" />
</body>
</html>
?>
|
|
|
|
|
Date :
2009-05-19 16:14:56 |
By :
danya |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|