Results 1 to 3 of 3

Thread: Textarea length script with images

  1. #1
    Join Date
    Nov 2006
    Location
    Moscow
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Textarea length script with images

    Some peoples on my web are like to post me large emailes via my e-mail form.

    I was thinking that it would be great to add posting indicator to my mailing form.

    I found a lot of word counters here - Form Effects - but showing how much words user posted means nothing.

    Then I think out another indicator...

    First of all, I will make some photos or use smileys to indicate my mood about amount of words.

    For example:
    50 words - image displaying " OK, keep going"
    100 words - image displaying " GREAT! You do not need to post more"
    150 words - image displaying " OOHMY... Are you really sure you need to write so much words?"
    200 words - image displaying " HMM... I think I`m not gooing to read such a large mail"

    According to words amount entered into textfield, the image (or image and textfield) will be changed.

    Please, help me to create such Form Effect

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    <textarea name="message" .... onChange="checklen(this)"></textarea>
    <img name="smiley" ...>

    The function should be SOMETHING like this... The logic is right but the exact code is not:

    function checklen(field) {
    if (strlen(field) < 50) { smiley.src = "happy.gif"; }
    else if (...<100) {..."laugh.gif"; }
    else if....
    else.....
    };


    The better option might be to use a <span> and change the contents thereof to relate, if you want to change more than just the image.
    I'm not quite sure how to do this.

    But... the above should give you an idea of what to do.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Nov 2006
    Location
    Moscow
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for reply!

    Speaking the truth, I`m not very in programming, but I`m trying!

Bookmarks

Posting Permissions

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