61 users online (1 members and 60 guests)  


  Results 1 to 2 of 2

Related

  1. Advanced Browser ~ Do you know of it.    Forum: General Discussion
    Replies: 4
  2. Advanced redirecting in Javascript    Forum: Javascript Forum
    Replies: 2
  3. Advanced Tables    Forum: HTML Forum
    Replies: 2
  4. Advanced Frames Question?    Forum: HTML Forum
    Replies: 4
  1. #1
    metaphyber's Avatar
    New User

    Status
    Offline
    Join Date
    May 2002
    Posts
    1

    Advanced Textarea question

    Okay, I've seen this done only once before and when I seen it I never thought nothing of it, now that I'm wanting to have this on my website to make my user's visit more pleasant, I can't find it again. I have been searching google typing in everything i could think of, but I can't figure out.

    When using the textarea tag, you can supply cols= and rows= ..... Well, what I want to be able to do is have like cols=50 and rows=10, or something like that, but if the user wants it bigger, they can click on the corner of the text area and resize it to their likings.

    I think I would need to use CSS possibly, like textarea style=whatever, but I'm not sure. I have looked everywhere and figure it out, maybe it's javascript? Who knows.

    I've asked all my friends (we all do a lot of webdesigning), but everyone seems to think it's impossible...NOTHING is impossible...Maybe one of yall know? Thanks ahead of time for trying at least.
    -metaphyber

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Its not impossible.

    Heres a simplified version that demonstrates how to access CSS attributes using JavaScript. When you focus on the textarea, it gets bigger, when your focus moves away, it gets smaller.

    Code:
    <head>
    <script language="JavaScript">
    <!--
    function bigme(obj) {
    
    obj.style.width='200px';
    
    }
    
    function smallme(obj) {
    
    obj.style.width='50px';
    
    }
    
    //-->
    </script>
    </head>
    
    <body>
    
    <textarea id="test" name="tester" onFocus="bigme(this)" onBlur="smallme(this)" cols="3" rows="10">
    </textarea>
    Have a play, you may come up with something you like.

    ALternatively, you can grab stuff from http://www.dynamicdrive.com . They have lots of DynamicHTML scripts there for free.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread