本文介绍了radioButtonList选择的值显示在文本框上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有3个单选按钮列表和一个文本框.
我想从每个单选按钮列表中选择一个值,并在文本框中显示该值.您可以使用以下代码:
var rblSelectType = document.getElementById(' hdnRbtnList').值; txtSelectedItem = document.getElementById(' hdntxtTextbox').值; var rbtnOne = rblSelectType + ' _ 0' ; var rbtnTwo = rblSelectType + ' _ 1' ; var rbtnThree = rblSelectType + ' _ 3' ; 如果(document.getElementById(rbtnOne).已选中){ txtSelectedItem.值 = " 您的值" ; } 其他 如果(document.getElementById(rbtnTwo).选中){ txtSelectedItem.值 = " 您的值" ; } 其他 如果(document.getElementById(rbtnThree).已选中){ txtSelectedItem.值 = " 您的值" ; }
hdnRbtnList-将成为您的RadiobuttonList ClientID
hdntxtTextbox-将是您的TextBox ClientID
希望对您有所帮助.
i have 3 radio button list and a text box.
i want to select value from each radio button list and show the value in textbox.
解决方案
这篇关于radioButtonList选择的值显示在文本框上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!