高分请教HTC(IE5.0版)中的属性重载?虎虎虎~
abent 2001-10-22 09:33:46 页面中:
<html>
<head><title>包含页面</title></head>
<body>
<input type="text" id="ddd" style="behavior:url(value.htc)">
<button onclick="alert(ddd.value)">GetValue</button>
<button onclick="ddd.value='111'">PutValue</button>
</body>
</html>
HTC中:
<public:component name="ValueReLoad">
<public:property name="value" put="putValue" get="getValue"/>
<script language="javascript">
var sValue
function putValue(argValue) {
sValue = argValue;
}
function getValue() {
return sValue + "Len";
}
</script>
</public:component>
我这样做的目的是为了让用户的输入或者通过脚本赋值到input中的值被自动的格式化,等到提交时直接提交被处理过后的值。而目前如果按下PutValue,则组件中的value元素被赋值,而ddd中并没有填写"111",我怎样才能让ddd中呈现"111"呢?