小编Ula*_*ing的帖子

coldfusion - 如何循环在同一页面中从getElementById传递的值?

我想从列表中循环选定的数字(cfselect).我尝试了getElementById但只能在同一页面上显示它.我无法将此数字传递给循环.有人能帮我吗?谢谢.

function item()

        var a = document.formName.numList.selectedIndex;
        document.getElementById('i').value = document. family.tBro.options[a].value;

        var n=document. family.tBro.options[a].value;


<!----OTHER INPUT TEXT BOXES --->

<cfform name="family" action="complete.cfm" method="post">

     How many brothers do you have?
     <cfselect name="tBro" onChange="item();" required="yes">
        <option value="1"> 1</option>
        <option value="2"> 2</option> 
        <option value="3"> 3</option>  
        <option value="4">4</option>
    </cfselect>                                                    

   <!---DISPLAY THE SELECTED CHOICE from getElementById--->
   Total number of brothers: <cfinput type="text" name="i" id="i">


   <!---LOOP x amount of time  from selected choice above. 
       For example, if 2 is selected, the below info will display two …
Run Code Online (Sandbox Code Playgroud)

coldfusion

0
推荐指数
1
解决办法
155
查看次数

标签 统计

coldfusion ×1