replacing textbox by text area

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Benjamin Anthony
    New Member
    • Mar 2010
    • 4

    replacing textbox by text area

    I have the following Code:

    <script type="text/javascript" language="javas cript">
    function FillTextBox(obj ) {
    document.getEle mentById("textb ox1").value = obj;
    }
    </script>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" >
    <tr>
    <td>
    <select name="combo1" id="combo1" onchange="FillT extBox(this.val ue)">
    <option value="">Select Answer</option>
    <option value="ans1">An swer 1</option>
    <option value="ans2">An swer 2</option>
    <option value="ans3">An swer 3</option>
    <option value="ans4">An swer 4</option>
    </select>
    </td>
    <td>
    <input type="text" name="textbox1" id="textbox1" />
    </td>
    </tr>
    </table>

    I want to replace the text box with textarea. Set the value of text area to disables so that no one can alter the answer but can copy the answer from the textarea.
    Futher it would be an added advantage if the Answers can be extracted from an excel sheet.
    Can any please help me with the coding.
  • Mayur2007
    New Member
    • Aug 2007
    • 67

    #2
    Hello,

    Replace <input type="text" name="textbox1" id="textbox1" /> with
    <textarea name="textbox1" id="textbox1" readonly="reado nly"></textarea>
    It will set textarea with readonly functionality.

    Thanks & Regards
    Mayur Bhayani

    Comment

    Working...