Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Textarea partially readonly

    When the screen appears, the text within the textarea should be in readonly mode and user should be able to continue to enter after the readonly text.

  • #2
    Regular Coder
    Join Date
    Mar 2006
    Posts
    725
    Thanks
    35
    Thanked 132 Times in 123 Posts
    You need two textareas, or a contenteditable element. A textarea is readonly or not readonly.

  • #3
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    You could always do a total kludge if you wanted your viewers to think they were entering text into the same textarea... see example below. Of course the "Merge Data" button would be your submit button, the div style could be in your CSS file, and the last textarea should be set to hidden. It's an ugly solution from a coding standpoint, but it would meet your criteria (sort of)
    Code:
    <form>
    <div id=faketextarea style="border:1px solid #e3e3e3; width:375;">
    <textarea id=t1 readonly style="border:0; overflow: auto;" cols=40 rows=1>This is the readonly text</textarea>
    <BR>
    <textarea id=t2 style="border:0; overflow: auto;" cols=40 rows=10></textarea>
    </div><BR>
    <input type=button value="Merge Results" onclick="this.form.t3.value=this.form.t1.value+' '+this.form.t2.value;">
    <BR>
    <textarea id=t3 cols=40 rows=10></textarea>
    </form>
    Last edited by EpicWebDesign; 05-24-2012 at 07:16 PM.

  • Users who have thanked EpicWebDesign for this post:

    arjun.nanda (05-25-2012)

  • #4
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    It works and I learned a new concept.Thx guys


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •