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.

SAEF and "email" button in formatting buttons

December 19, 2008 6:32pm

Subscribe [2]
  • #1 / Dec 19, 2008 6:32pm

    Shannon Smith

    161 posts

    Hello,

    I’ve created a few stand alone entry forms for my website and I’ve noticed that all buttons in the formatting buttons work except the email button. It lets you go through the motions of inputting an email address and then doesn’t actually input it. I guess this is likely related to the idea that it is encoded and I’m also having problems with my stand alone edit form completely messing up my encoded emails. (Not being able to enter them in my SAEF, I have entered them through the control panel… if I then edit the entry with a stand alone edit form it gets messed up… the encoded email gets turned into messy code and is displayed as such on the webpage). I had found a solution for that I think, but now I can’t find the forum post. I believe it had to do with adding TinyMCE or some other editor, but I don’t really want to have to add one of those editors to my forms. Is there any other way to fix these problems?

    Thanks!

  • #2 / Dec 19, 2008 6:47pm

    Sue Crocker

    26054 posts

    Have you considered making an Edit This link for each entry? That does use the CP to edit, but you’d be taken directly to the entry you’d want.

  • #3 / Dec 19, 2008 7:20pm

    Shannon Smith

    161 posts

    Hi Sue,

    I’m trying to avoid the control panel if at all possible. There will be quite a few people adding/editing entries on the site and I want the forms as simple as possible. Other than this issue, the stand alone entry/edit forms work quite well (except for an issue with related fields in the edit form, but I think I can live with that). I really need this email thing to work if at all possible. Is there no way to get it to work? It seems silly to have it included in the formatting buttons at all if it isn’t going to work.

    Thanks again.

  • #4 / Dec 21, 2008 3:52pm

    Greg Aker

    6022 posts

    Shannon,

    I’m sorry, but I"m not quite following exactly what *isn’t* working with the emails when you enter via the saef?

    Also, what version/build of ExpressionEngine are you running?  both values can be found in the footer of your control panel.

    -greg

  • #5 / Dec 21, 2008 5:28pm

    Shannon Smith

    161 posts

    Hi Greg,

    Thanks for helping out.

    I’m using ExpressionEngine 1.6.6, Build: 20081114

    I’ll try and explain a little better what is happening. I’m in one of my stand alone entry forms. I click in a field and then click on the “email” button. It brings up the pop-up windows asking for the email address and other details just as in the control panel. Difference is that when you are finished filling in everything, nothing gets put in the field you had your cursor in. If I do the same thing for the link or image button, it works fine and puts the proper code in the field. It’s really just the email button that doesn’t work. I was assuming it has something to do with the encode that goes along with the email button, but I’m just guessing.

    In addition, the email encoding gets messed up when I try to edit an entry that has an encoded email in it (which, because of the problem above, I can only put in using the control panel). It gets converted to the following:


    [removed]
    //<![CDATA[
    var l=new Array();
    var output = ‘’;
    l[0]=’>’;l[1]=‘a’;l[2]=’/’;l[3]=’<’;l[4]=’ 109’;l[5]=’ 111’;l[6]=’ 99’;l[7]=’ 46’;l[8]=’ 121’;l[9]=’ 116’;l[10]=’ 101’;l[11]=’ 102’;l[12]=’ 97’;l[13]=’ 115’;l[14]=’ 45’;l[15]=’ 116’;l[16]=’ 101’;l[17]=’ 110’;l[18]=’ 64’;l[19]=’ 115’;l[20]=’ 101’;l[21]=’ 109’;l[22]=’ 117’;l[23]=’ 115’;l[24]=’ 101’;l[25]=’ 114’;l[26]=’>’;l[27]=’\”’;l[28]=’ 109’;l[29]=’ 111’;l[30]=’ 99’;l[31]=’ 46’;l[32]=’ 121’;l[33]=’ 116’;l[34]=’ 101’;l[35]=’ 102’;l[36]=’ 97’;l[37]=’ 115’;l[38]=’ 45’;l[39]=’ 116’;l[40]=’ 101’;l[41]=’ 110’;l[42]=’ 64’;l[43]=’ 115’;l[44]=’ 101’;l[45]=’ 109’;l[46]=’ 117’;l[47]=’ 115’;l[48]=’ 101’;l[49]=’ 114’;l[50]=’:’;l[51]=‘o’;l[52]=‘t’;l[53]=‘l’;l[54]=‘i’;l[55]=‘a’;l[56]=‘m’;l[57]=’\”’;l[58]=’=’;l[59]=‘f’;l[60]=‘e’;l[61]=‘r’;l[62]=‘h’;l[63]=‘a ‘;l[64]=’<’;
    for (var i = l.length-1; i >= 0; i=i-1){
    if (l.substring(0, 1) == ' ') output += "&#"+unescape(l.substring(1))+";";
    else output += unescape(l);
    }
    document.getElementById(‘eeEncEmail_SZw6XhuYNe’)[removed] = output;
    //]]>
    [removed]

    And if you submit it like this, then that will display as the output on your webpage. So, it basically breaks it if I try and use the edit form. So, to sum up, I can’t use the button at all in the entry form and even if I could, the edit form would do the above to it and break it. So, I’m looking for a solution to both problems without having to add TinyMCE or some other editor. I hope this makes more sense.

    Thanks again.

  • #6 / Dec 21, 2008 5:34pm

    Greg Aker

    6022 posts

    Shannon:

    I see what you mean.  So we’re on the same page, what method did you use to create the stand-alone edit form?

    -greg

  • #7 / Dec 21, 2008 5:38pm

    Shannon Smith

    161 posts

    Hi Greg, I’m not sure I understand your question about what method I used. Is there more than one method? I just copied the stand alone entry form code from the documentation and modified the fields as needed. It doesn’t work in any of my forms and one of them is pretty basic. I can post the code if you want. That may explain things a bit better.

  • #8 / Dec 21, 2008 5:42pm

    Shannon Smith

    161 posts

    Hi Greg,

    I figured I’d quickly post my code because I’m having to leave for the rest of the day. Here is the most basic form and it doesn’t work:

    {exp:weblog:entry_form weblog="{embed:the_weblog}" return="site/blog/thankyou" preview="site/blog_preview"}
    
    <div id="entry_form">    
    
    <h2>Post a Blog Entry</h2>
    <p><div class="divider"></div></p>
    
    <p><div class="longer_label"><br />
    Blog Title:<br />
    </div></p>
    
    <p><div class="post_field"><br />
        <span><input type="text" class="textbox" name="title" id="title" value="{title}" maxlength="100"></span><br />
    </div></p>
    
    <p><input type="hidden" class="textbox" name="url_title" id='url_title' value="{url_title}" maxlength="75" /></p>
    
    <p><div class="longer_label">Formatting:<br />
    </div></p>
    
    <p><div class="post_field"><br />
              {formatting_buttons}</p>
    
    <p></div></p>
    
    <p>{custom_fields}<br />
    <div class="longer_label"><br />
        {if required}<span class="red">* </span>{/if}{field_label}:<br />
    </div></p>
    
    <p><span><div class="post_field"></p>
    
    <p>{if textarea}<br />
    <span><textarea class="textarea" id="{field_name}" name="{field_name}" dir="{text_direction}" style="height:{rows}0px;" cols="50" rows="{rows}">{field_data}</textarea></span><br />
    <div class="instructions">{field_instructions}</div><br />
    {/if}</p>
    
    <p><br />
    {if textinput}<br />
    <span><input type="text" class="textbox" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50"></span><br />
    <div class="instructions">{field_instructions}</div><br />
    {/if}</p>
    
    <p>{if pulldown}<br />
    <span><select id="{field_name}" name="{field_name}"><br />
    {options}<option value="{option_value}"{selected}>{option_name}</option>{/options}<br />
    </select></span><br />
    <div class="instructions">{field_instructions}</div><br />
    {/if}</p>
    
    <p>{if date}<br />
    <span><input type="text" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50"></span><br />
    <div class="instructions">{field_instructions}</div><br />
    {/if}</p>
    
    <p>{if relationship}<br />
    <span><select id="{field_name}" name="{field_name}"><br />
    {options}<option value="{option_value}"{selected}>{option_name}</option>{/options}<br />
    </select></span><br />
    <div class="instructions">{field_instructions}</div></p>
    
    <p>{/if}</p>
    
    <p></div></span><br />
    {/custom_fields}</p>
    
    <p><br />
    {status_menu}<br />
    <div class="longer_label">Status:</div><br />
    <div class="post_field"></span><select name="status" class="textbox2">{select_options}</select></span></div><br />
    {/status_menu}</p>
    
    <p>{category_menu}<br />
    <div class="longer_label">Categories:</div><br />
    <div class="post_field"><span><select name="category[]" size="4" multiple="multiple" class="textbox2"></span><br />
    {select_options}<br />
    </select><br />
    </div><br />
    {/category_menu}</p>
    
    <p><div class="longer_label"></div><br />
    <div class="post_field"><br />
    <input type="checkbox" name="allow_comments" value="y" {allow_comments} /> Allow Comments<br />
    </div></p>
    
    <p><br />
    <div class="longer_label"></div><br />
    <div class="post_field"><input type="hidden" class="textbox2" name="entry_date" value="{entry_date}" maxlength="23" size="25" /></div></p>
    
    <p><div class="longer_label"></div><br />
    <div class="post_field"><br />
    <input type="image" class="entry_submit" src="{site_url}images/interface/submit-button.gif" name="submit" value="Submit" /><br />
    <input type="image" class="entry_submit" src="{site_url}images/interface/preview-button.gif" name="preview" value="Preview" /><br />
    </div></p>
    
    <p><br />
    </div><br />
    {/exp:weblog:entry_form}

  • #9 / Dec 22, 2008 1:08pm

    Greg Aker

    6022 posts

    Shannon:

    What extensions do you currently have running?  Are you currently using TinyMCE?

    -greg

  • #10 / Dec 22, 2008 2:12pm

    Shannon Smith

    161 posts

    Hi Greg,

    I currently have the following extensions running:

    Bad Behavior, CoolLocation, jQuery, and LG SAEF File Upload.

    Plugins:

    SAEF Calendar, Character Limiter, Form_Helper, List Maker, Magpie RSS Parser, Word Limiter, and XML Encode.

    I will likely end up using either Character Limiter or Word Limiter. I haven’t decided which to use yet… that’s why I have both of those right now. I may not end up using List Maker.

    Thanks again.

  • #11 / Dec 23, 2008 4:37pm

    Sue Crocker

    26054 posts

    Shannon, the field you’re putting the email address in, is it a standard text field?

    What happens if you temporarily disable your extensions? You’d do that by clicking the Disable Extension green button.

  • #12 / Dec 23, 2008 5:06pm

    Shannon Smith

    161 posts

    Yep. Standard textarea fields. You can see my form code above. It doesn’t work if I use any of the fields listed in that form code for summary, body, or extended text. I’ll try disabling some extensions and see if that works. From what I recall though, the problem was there before I installed most of these extensions.

    Does this work for others then?

  • #13 / Dec 23, 2008 5:10pm

    Shannon Smith

    161 posts

    Still doesn’t work even with disabling extensions. I haven’t tried removing plugins. If I remove the plugins, does it delete them?

  • #14 / Dec 23, 2008 5:21pm

    Shannon Smith

    161 posts

    I just noticed that the form code I pasted earlier uses the {custom fields} loop method and doesn’t list my field names. Sorry about that. The fields I’m using in this case (for the code I pasted that is) are actually the standard custom fields that come with the expression engine install… summary, body, extended text. They are all set to textarea in the admin section of the control panel and the formatting is auto
    . Sorry for the confusion there. I forgot that particular form was using the {custom fields} loop. My other forms I have manually entered the fields, but I get the same problem regardless.

  • #15 / Dec 23, 2008 6:02pm

    Sue Crocker

    26054 posts

    The code for a Stand Alone Edit form and a Stand Alone Entry form are different. The code you listed appears to be an Entry form.. Are you using Solspace’s Edit form?