如何在webform控件上设置fous [英] how to set fous on webform controls
本文介绍了如何在webform控件上设置fous的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想专注于控制我点击但我的代码不工作
这是我的代码
else if (答案是HandwrittenAnswer)
{
this .Sourcecode.AppendLine( \t\t\t\t< textarea id = ' + id + 'name =' + id + 'value =''style ='position:absolute;
+ top: + top + px; left: + left + px; height: + height + px; width: + width + px;
+ visibility:hidden; z-index:2; resize:none;'>< / textarea>);
this .Sourcecode.AppendLine( \t\t\t\tdocument.getElementById id =' + id + '。focus(););
}
使用上面的代码,当我点击我的网页表单时,它进入控件我点击但没有焦点设置它意味着当我点击文本框打开,当我写的东西什么都没有发生因为没有焦点所以我需要点击一个更多的时间然后可以写一些东西,但我想直接设置焦点当我点击我的控件。
任何人有理想什么是错的?????解决方案
解决方案
请查看以下链接:
JavaScript将焦点设置为HTML表单元素 [ ^ ]
I want to set focus on control i clicked but my code not working
Here is my code
else if (answer is HandwrittenAnswer)
{
this.Sourcecode.AppendLine("\t\t\t\t<textarea id='" + id + "' name='" + id + "' value='' style='position: absolute; "
+ "top: " + top + "px; left: " + left + "px; height: " + height + "px; width: " + width + "px; "
+ "visibility: hidden; z-index: 2; resize: none;'></textarea>");
this.Sourcecode.AppendLine("\t\t\t\tdocument.getElementById id='" + id+ "' .focus();");
}
with above code when i click on my web form it goes inside the control i click but there is no focus set it means when i click text box is opened and when i write something nothing happens because there is no focus so i need to click one more time then can write something but i want to set focus directly when i click on my control.
Anyone got idear whats wrong ?????Solution
解决方案
Please have a look on the below links:
JavaScript set focus to HTML form element[^]
这篇关于如何在webform控件上设置fous的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文