www.webdeveloper.com
Results 1 to 3 of 3

Thread: Textarea Issue

  1. #1
    Join Date
    Jun 2013
    Posts
    7

    Textarea Issue

    Im currently modifying an outdated CMS to fit my needs as a torrent link manager. I updated the BBCode textarea to be able to handle html coding because I wanted to be able to use a fancybox javascript. The original bbcode textarea could not do this. If I don't use html the new textarea works fine.

    Please keep in mind that I am more comfortable with Html and ASP but I'm quickly trying to pick up basic PHP functions. So bare with my limited knowledge.

    I put this html code in the textarea:

    <a href="http://imghost.com/images/984145.jpg" class='ku_fancybox'>Miami Heat Clip | 22.27&nbsp;MB | AVI</a>

    And the textarea area shows me the correct output:

    Miami Heat Clip | 22.27*MB | AVI

    This link is suppose to open up the preview image in a fancybox but when I submit the form I get this instead:

    <p><a href=„http://imghost.com/images/984145.jpg“ class=„ku_fancybox“>Miami Heat Clip | 22.27&nbsp;MB | AVI</a>
    </p>

    For some reason it's turning my 2 of my quotations upside down.
    Does anyone have an explanation for this? Or have some info that will point me in the right direction?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2013
    Posts
    4
    You should use htmlspecialchars

  3. #3
    Join Date
    Jun 2013
    Posts
    7
    This is the original bbcode textarea:
    PHP Code:
    <div class="box">
                            <
    div class="bbcode">
                                <
    input type="button" value="{t k="tpl_post_bbcode_b"}" onclick="javascript:simple_bbcode(this,'B')" style="font-weight: 700" />
                                <
    input type="button" value="{t k="tpl_post_bbcode_i"}" onclick="javascript:simple_bbcode(this,'I')" style="font-style: italic" />
                                <
    input type="button" value="{t k="tpl_post_bbcode_u"}" onclick="javascript:simple_bbcode(this,'U')" style="text-decoration: underline" />
                                &
    nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <
    input type="button" value="{t k="tpl_post_bbcode_quote"}" onclick="javascript:simple_bbcode(this,'QUOTE')" />
                                <
    input type="button" value="{t k="tpl_post_bbcode_code"}" onclick="javascript:simple_bbcode(this,'CODE')" />
                                <
    input type="button" value="{t k="tpl_post_bbcode_url"}" onclick="javascript:simple_bbcode(this,'URL')" />
                                <
    input type="button" value="{t k="tpl_post_bbcode_email"}" onclick="javascript:simple_bbcode(this,'EMAIL')" />
                                <
    input type="button" value="{t k="tpl_upload_bbcode_img"}" onclick="javascript:simple_bbcode(this,'IMG')" />
                                <
    br/>
                                <
    input type="button" value="{t k="tpl_post_bbcode_big"}" onclick="javascript:add_bbcode('[size=20][/size]')" />
                                <
    input type="button" value="{t k="tpl_post_bbcode_small"}" onclick="javascript:add_bbcode('[size=12][/size]')" />
                                <
    input type="button" value="{t k="tpl_post_bbcode_color"}" onclick="javascript:add_bbcode('[color=#000000][/color]')" />
                                &
    nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <
    input type="button" value="{t k="tpl_post_bbcode_break"}" onclick="javascript:add_bbcode('[break]');this.disabled=true" />
                                <
    span id="popup_container"></span>
                            </
    div>
                        </
    div>
                        <
    div class="spacer"></div>
                        <
    div class="box">
                            <
    textarea name="post_content" id="txt" class="newpost_textarea" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" ondblclick="storeCaret(this);">{if isset($dl)}{$dl.content|escape:"html"}{/if}</textarea>
                        </
    div
    And this is what I modified:
    (1. I deleted the input types from above)
    (2. I added this to the header)
    <script src="{$rsurl}scripts/whizzywig2011.js" type="text/javascript"></script>
    (3. I changed the class name of the textarea)
    <div class="spacer"></div>

    <div class="spacer"></div>
    <div class="box">
    <textarea name="post_content" id="txt" class="WYSIWYG" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" ondblclick="storeCaret(this);"> {if isset($dl)}{$dl.content|escape:"html"}{/if}</textarea>
    </div>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles