getElementByID /参数问题 [英] getElementByID/parameters problem

查看:62
本文介绍了getElementByID /参数问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我搜索了论坛,看看我是否能找到问题的答案,但无济于事。


我有一个3 x 3单元格的表格。如果选择,这些单元格中的每一个都会从绿色变为黄色,如果未选中,则会变为绿色。我想要做的是当我按下继续按钮时,我点击的单元格将被选中。连接到ID名称,以便我可以看到用户选择了哪些单元格。


我在java中设置了一个动作类,以在tomcat日志文件stdout中显示参数名称。但是它没有传递任何参数。


我意识到问题在于javascript并且不确定如何动态使用elementbyid代码以便它适用于任何单元格。 br />

我希望我已经明确了解问题并且你能够提供帮助。


谢谢


Anonymousstar

JAVASCRIPT


< script language =" javascript">

展开 | 选择 | Wrap | 行号

解决方案

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号


展开 | 选择 | Wrap | 行号


多亏了这一点,它改变了颜色,但它仍然没有传递值,即已经选择的单元格。我检查了stdout文件,但没有。其他任何东西都会很棒,或者它应该可以解释代码也很有用。


谢谢



使用保存在变量 selected


中的值

Hi All,

I have searched the forums to see if I can find an answer to my question but to no avail.

I have a form below with a 3 x 3 cell. Each of these cells change from green to yellow if selected and back to green if unselected. What I would like to do is when I press the continue button the cells I have clicked will have "selected" concatenated onto the ID name so that I can see which cells the user has selected.

I have set up an action class in java to show the parameter names in the tomcat log file "stdout" but it is not passing any parameters.

I realise that the problem is with the javascript and not sure how to dynamically use the elementbyid code so that it applies to any of the cells.

I hope I have made myself clear on the problem and you will be able to help.

Thanks

Anonymousstar

JAVASCRIPT

<script language="javascript">

Expand|Select|Wrap|Line Numbers

解决方案

Expand|Select|Wrap|Line Numbers


Expand|Select|Wrap|Line Numbers


Thanks for that, it changes colour which is great but it still is not passing the values i.e the cells that have been selected. I checked the "stdout" file but nothing. Anything else would be great or if it should work an explanation of the code would be useful as well.

Thanks

use the value saved in the variable selected


这篇关于getElementByID /参数问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆