ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Adding value to RTE in SafeCracker

June 18, 2012 2:50pm

Subscribe [2]
  • #1 / Jun 18, 2012 2:50pm

    John-Gordon

    76 posts

    Good afternoon,

    I have this inside of safecracker tags:

    <textarea id="edit-introduction" name="member-introduction" class="rte" rows="6" value="{member-introduction}"></textarea>

    .rte is the selector to add the RTE styles and that works well. The problem occurs with the value attribute.  I’m not getting anything to show in the faux-textarea.  Using developer tools, I see it is added to the textarea value, but it is not showing in the rte div.

    Any ideas?

    Thank you.

  • #2 / Jun 19, 2012 3:09pm

    Shane Eckert

    7174 posts

    Hello John-Gordon,

    I am sorry to hear you are running into this odd behavior.

    Can you show me the entire form?

    Is that a global variable that you have defined that you are using for the value?

    Please let me know!

    Cheers,

  • #3 / Jun 19, 2012 4:03pm

    John-Gordon

    76 posts

    I’m handling users within EE entries, so that variable is a field that displays text from the rich text editor.  The RTE shows up just fine, it just the value that fails to show.

    The form uses the third party module zoo_visitor, but it acts exactly like safecracker.  I’ve changed the form to safecracker for now so you have a better time debugging.

    {exp:safecracker channel="members" entry_id="{zoo_visitor_id}" error_handling="inline" rte_selector=".rte" error_delimiters="<p class="help-inline">|" include_jquery="no" return="account/edit/profile/success" class="form-horizontal" allowed_groups="5|6|7" secure_action="yes" secure_return="yes"}
        <div class="control-group">
            <label for="edit-introduction" class="control-label">Test</label>
            <div class="controls">
                <textarea id="edit-introduction" name="member-introduction" class="rte" rows="6" value="{member-introduction}"></textarea>
            </div>
        </div><!--/.control-group-->
        
        <div class="form-actions">
            <button type="submit" class="btn btn-success">Update</button> <a href="http://{path=account}" class="btn">Cancel</a>
        </div><!--/.form-actions-->
    {/exp:safecracker}
  • #4 / Jun 21, 2012 1:40pm

    Shane Eckert

    7174 posts

    Hey,

    I may be way off, but are you trying to display the value?

    Like so?

    <textarea id="edit-introduction" name="member-introduction" class="rte" rows="6" value="{member-introduction}">{member-introduction}</textarea>

    Please let me know.

    Cheers,

  • #5 / Jun 22, 2012 11:13am

    John-Gordon

    76 posts

    Well that was it.  A simple HTML problem! I always forget the value needs to be between the textarea tags, and not inside the value attribute (there is no value attribute for textarea).

    Thanks Shane!  Have a good weekend.

  • #6 / Jun 25, 2012 10:38am

    Shane Eckert

    7174 posts

    Hey John-Gordon,

    Glad to hear it! Forms are funny that way, it’s a use it or lose it thing with them. 😊

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases