SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist AsianGirl's Avatar
    Join Date
    Oct 2003
    Location
    U.S.A
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question need help with <textarea> & <input>

    I'm currently working on this script and there's a little javascript problem that i can't seem to find out what's going on

    <input type="text" name="Subject" maxlength="{$config['subjectlength']}" class="formboxes" size="60" value="$Subject" onkeyup="myvalue(this,event);" />

    <textarea cols="$TextCols" rows="$TextRows" class="formboxes" name="Message" onkeyup="storeCaret(this); myvalue(this,event);" onclick="storeCaret(this);"></textarea>

    As you can see i have a Subject box & Message box, anyway my problem is ...when i type stuff in the textarea box ...and click to choose a smiley ...all my texts disappear/erase and replace by a smiley

    can anyone help me to fix this problem ?? it's frustrated if you typed a really long message and click a smiley ...the whole thing get erase and replace by a smiley ....

    i'm not sure if my question is clear but ....hopefully someone in here is able to understand my question and help me out...thanks a million

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I understand entirely.

    1) Where do the variables get populated though ?
    $TextCols, for example ...
    I'm just curious what langauge is parsing this for you.

    2) Can you post the function you are using to add smileys, please? I think I know what's wrong with it - but I'd need to see it to be sure.

    G
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is pretty vague....
    ...when i type stuff in the textarea box ...and click to choose a smiley ...
    Hmm...click a button (educated guess) and call a function...yes? Does the function do this?

    document.Message.value = ':)';

    ...or something similar? If so, you need to concatenate (add) that shmilie to the end of what's already there:

    document.Message.value += ':)';

    Otherwise, never mind.
    ::: certified wild guess :::

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Steal what code you need from this

    www.peterbailey.net/dhtml/taeditor.htm
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •