how to get a text box with the value selected in select box

Posted by udaya on Stack Overflow See other posts from Stack Overflow or by udaya
Published on 2010-05-18T05:33:40Z Indexed on 2010/05/18 5:40 UTC
Read the original article Hit count: 164

Filed under:
|

hi This is my view page here i have a select box

<tr>
    <td>Chidren</td>
    <td>:</td>
    <td><select style="font-family: verdana; min-width: 52px;" id="ddlChildren"
             name="ddlChildren"  class="required" onChange="return Check_Adult('dd1Age')" >
            <option value="">children</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option></select>
    </td>
  </tr>

with the value from select box if the value is one then i need to create a text box if the value is two then i need to create two ,,, and respectively In my Check_Adult javascript function ,,I did this

function Check_Adult()
{

    var Child= document.getElementById('ddlChildren').value;
    if( Child==1)
    {
       <? echo '<input type="text" name="child" id="child">' ?>
    }
}

But the text box is not created how to create it?

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript