ASP:带有onfous的TEXTBOX和带有javascript的onblur [英] ASP:TEXTBOX with onfous and onblur with javascript
问题描述
我有这样的HTML代码 I have an HTML code like this < 输入 =文本" 类 ="col2" 值 =""*姓氏" ="test (this);" /> 功能 <input type="text" class="col2" value="*Last Name" onfocus="test(this);" onblur="test(this);" /> function test(obj){ test(obj) { 你好, 感谢您的发帖!我建议将您的问题发布到 Thank you for your post! I would suggest posting your question in 或 MSDN>论坛首页> .NET开发位于此处: MSDN > Forums Home > .NET Development located here: http://social.msdn. microsoft.com/Forums/zh-CN/category/netdevelopment 希望有帮助. 祝你有美好的一天! 这篇关于ASP:带有onfous的TEXTBOX和带有javascript的onblur的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
这是一个文本框字段,当您单击它时,它将取出";姓氏"写在框中,当您在框外单击时,它将再次具有姓氏"字样.写在框中.
This is a textbox field when u click on it it will takeout the "Last Name" written in the box and when u click outside the box it will again have "last Name" written in the box.
如果
obj.first = 空 ;
}
{
obj.Val = 空 ;
}
}
else 如果 ;
obj.first = 'true' ;
}}
我想用asp文本框替换输入文本
但是我没有得到与输入类型文本一起使用的相同的Javacript功能.
我们可以用文本框来覆盖onfocus和onblur并让它们运行javacript吗?
我不确定该怎么做?
if(obj.Val) {
if (obj.value == '') {
obj.value = obj.Val;
obj.Val = null;
obj.first = null;
}
else {
obj.Val = null;
}
}
else if (!obj.first) {
obj.Val = obj.value;
obj.value = '';
obj.first = 'true';
} }
I want to replace the input text with asp textbox
but I am not getting the same javacript feature which i am using with input type text.
Can we hadd the onfocus and onblur with textbox and have them run the javacript.
I am not sure how can we do that?推荐答案