在收音机中自动选择 [英] Autoselect in a radio

查看:97
本文介绍了在收音机中自动选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有收音机和选择/输入的组合:
http:// sneleopard .dk / radio.html


当用户

对字段1执行某些操作时,是否有自动设置广播1的javascript,以及自动设置无线电2,当

用户对字段2执行某些操作时?

I have combination of radio and select/input:
http://sneleopard.dk/radio.html

Is there a javascript which automatically sets radio 1, when the user
does something with field 1, and automatically sets radio 2, when the
user does something with field 2?

推荐答案

hygum写道:
hygum wrote:
我有收音机和选择/输入的组合:
http://sneleopard.dk/radio.html

当用户使用字段1执行某项操作时,是否有自动设置广播1的javascript,并且当
用户对字段2执行某些操作时自动设置无线电2?
I have combination of radio and select/input:
http://sneleopard.dk/radio.html

Is there a javascript which automatically sets radio 1, when the user
does something with field 1, and automatically sets radio 2, when the
user does something with field 2?




是的,但它有一个问题:你有车吗?这可以从阿姆斯特丹开往巴黎吗?

它在javascript中是非常基本的,但是你找不到''javascript''

将在你当前的设置中同时工作。


我知道我现在还不是很有帮助。 :-)

你需要做什么/学习:

- 命名元素

- onChange eventhandler来检测某个字段的变化。

- 如何更换一个radiobuttongroup

类似于:

document.forms [''yourformname'']。radiogroupname [0] .checked =祝你好运;


祝你好运。


问候,

Erwin Moller



Yes, but it a question like: "Do you have a car that can drive from
Amsterdam to Paris?"
It is very basic in javascript, but you will not find ''a javascript'' that
will work at once in your current setup.

I know I am not very helpfull untill now. :-)
What you need to do/study:
- naming formelements
- onChange eventhandler to detect a change in some field.
- how to adres a radiobuttongroup
something like:
document.forms[''yourformname''].radiogroupname[0].checked = true;

Good luck.

Regards,
Erwin Moller

< br>

hygum写道:
我有收音机和选择/输入的组合:
http://sneleopard.dk/radio.html

是否有自动设置收音机1的javascript,当用户
时使用字段1的东西,并自动设置收音机2,当
用户对字段2执行某些操作时?
I have combination of radio and select/input:
http://sneleopard.dk/radio.html

Is there a javascript which automatically sets radio 1, when the user
does something with field 1, and automatically sets radio 2, when the
user does something with field 2?




您需要清楚地解释您的要求。一个单选按钮应该总是选择
,默认选择哪一个?


所选按钮是否代表最后一个被更改的字段?

或者,如果字段1更改,则按钮1会被选中;如果字段2更改,则按钮2会更改吗?在这种情况下,是否应同时选择两者?如果是这样,那么他们可能应该是复选框而不是单选按钮。


进一步的帮助取决于获取更多信息。


-

Rob



You need to clearly explain your requirements. One radio button should
always be selected, which one should be selected by default?

Should the selected button represent the last field that was changed?
Or does button 1 get selected if field 1 changes and button 2 if field 2
changes? Should both be selected at the same time in this case? If so,
then they probably should be checkboxes not radio buttons.

Further help is dependant on getting more information.

--
Rob


我听起来不是那么愚蠢!


默认应该是收音机2.


不,这不是我想要的复选框。 radiocheck将随着字段的变化而改变。所以Rob建议:如果字段1改变则按钮1获得

如果字段2改变则选择按钮2

I''m not so stupid as I sound!

The default should be radio 2.

No it''s not checkboxes I want. The radiocheck shall change following
the changes in the fields. So it is what Rob suggests: button 1 get
selected if field 1 changes and button 2 if field 2 changes.


这篇关于在收音机中自动选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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