View Single Post
Old 04-27-2008, 02:20 PM   #3 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Something like this?

javascript Code:
function TalkPHP_AddFields(pTarget)
{
    var iValue = parseInt(pTarget.value);
   
    if(!iValue)
    {
        return;
    }
   
    var pP = document.getElementById('pContainer');;
    pP.innerHTML = '';
   
    for(iIndex = 0; iIndex < iValue; iIndex++)
    {
        var pInput = document.createElement('input');
        pP.appendChild(pInput);
    }
}

html4strict Code:
<select onchange="TalkPHP_AddFields(this);">

    <option value="1">Ferret</option>
    <option value="2">Cat</option>
    <option value="3">Dog</option>

</select>

<p id="pContainer">

</p>
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote