《js高手和struts标签高手来》关于标签显示问题

Aaron陌 2011-01-07 02:05:48


这是我的标签要获取的内容、
<logic:iterate id="obj" name="businessList" indexId="index">

<tr>
.
.
.
<td>

<html:textarea name="obj" property="bidScope" styleId = "ywAreaid" cols="5" rows="1"

style="overflow:hidden;width:100%;border:0;" readonly="true"

onfocus="openare()" onblur="closeare()"></html:textarea>

</td>

<td>
....
</td>
.
.
.
</tr>

</logic:iterate>
我读取数据的时候,默认是显示 1行 5个字的 。其实有好多个字、!

我要的效果是当我鼠标点击 文本域的时候,显示所有内容。
当失去焦点的时候,就恢复。

------------------------------------------------------------------
<html:textarea name="obj" property="bidScope" cols="5" rows="1" style="overflow:hidden;width:100%;border:0;" readonly="true"

onfocus="window.activeobj=this;this.clock=setInterval(function(){activeobj.style.height=activeobj.scrollHeight+'px';},200);"

onblur="window.activeobj=this;this.clock=setInterval(function()

{activeobj.style.height=80+'px';},200);"></html:textarea>


上面这个可以变大适应内容大小、 可是 不能恢复!


-------------------------------------------------------

js不好菜弄不出啊、 高手帮帮忙!

顺便问几个问题、

为什么我用getelementbyId("ywAreaid").value; 得不到我读出来的值 ;



...全文
195 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Aaron陌 2011-01-07
  • 打赏
  • 举报
回复


哎呀、白白送20分! 给谁呢....

是美女的举手啊! 女士优先!
Aaron陌 2011-01-07
  • 打赏
  • 举报
回复

我已经解决了。。 摸索了差不多一天了、呵呵!

慢慢试出来的、 .

主要的是传值问题
-------------------

<html:textarea name="obj" property="bidScope" cols="5" rows="1" style="overflow:hidden;width:100%;border:0;" readonly="true"

onfocus="openare(window.activeobj=this)"
onblur="closeare(window.activeobj=this)"
></html:textarea>


这样也可以,太帅了!

-------------------------

function openare(obj) //获取滚动高度 作为高度!
{
obj.style.height=obj.scrollHeight;
}

function closeare(obj){ //这里恢复我给了17px;

obj.style.height=17;

}
qingralf 2011-01-07
  • 打赏
  • 举报
回复
struts标签和js一点关系都没有.虽然他们都写在页面上.所以不能用js的getElementById取出struts标签的值
汉尼拔 2011-01-07
  • 打赏
  • 举报
回复
等待高手解答,友情up,顺便说下,你这分也太低了吧

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧