I'm pretty much a complete novice when it comes to this.
I'm trying to create a one dynamic text field based on multiple selections from a previous drop-down menu. I'm using this function:
In this block of code:Code:function toggleField2(val) { var p = document.getElementById('No'); (val == 'No')? p.style.display = 'block' : p.style.display = 'none'; }
This works great for displaying the additional field, when the user selects "No."Code:<select class="text" name="answer_103" onChange="toggleField2(this.value);"> <option value="0">Please choose one...</option> <option value="Easy">Yes, quite easily</option> <option value="Yes">Yes</option> <option value="Almost">Not exactly</option> <option value="No">Not at all</option> </select> </td> </tr> <tr> <td align="right" width="60%"> <input class="text" type="text" name="No" id="No" onfocus="this.value=''; this.onfocus=null" size="46" style="display: none;" value="Please tell us why..."> </td> </tr>
What I would like to do is have the additional field appear when the user selects either "Almost" OR 'No."
Any help would be hugely appreciated.



Reply With Quote
Bookmarks