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: File form field not appearing

October 10, 2011 4:37am

Subscribe [5]
  • #1 / Oct 10, 2011 4:37am

    *Mark*

    60 posts

    Hello

    I’m getting {file} showing on the SAEF rather than the actual file upload field.

    http://inspr.in/Apf1

    {custom_fields}
     
    {if file}
    
    <strong>IMPORTANT: </strong><span>80px by 80px only » jpg/png/gif</span>
    
    {file}
    {/if}
    
    {/custom_fields}

    http://inspr.in/Apz7

    Any ideas please? Many thanks.

  • #2 / Oct 10, 2011 12:17pm

    Mark Bowen

    12637 posts

    Hi *Mark*,

    You have :

    {if file}
     {file}
    {/if}

    in your code above whereas the documentation shows that it should in fact be :

    {if file}
     {display_field}
    {/if}

    Could you change your code to the above and see if that fixes this up for you please.

    Thanks,

    Mark

     

  • #3 / Oct 12, 2011 4:31am

    *Mark*

    60 posts

    Hey Mark 😊

    That outputs the following:

    http://inspr.in/AtnN

    When I click it nothing happens other than appending a # to the URL. I was hoping for an upload file form field.

    Many thanks for your time.

    Best,
    Mark

  • #4 / Oct 12, 2011 11:16am

    Mark Bowen

    12637 posts

    Hi *Mark*,

    A couple of questions if I may. What version of ExpressionEngine are you running and is this a new build or an update?

    Could you also show me the rest of the page template if possible?

    Are you including your own version of jQuery or letting Safecracker do this for you?

    Thanks,

    Mark

  • #5 / Oct 13, 2011 6:02am

    *Mark*

    60 posts

    Morning Mark 😊

    Build 2.2.2

    {html_head}
    
     <title>Submit - Anti Spec Work and Crowdsourcing Campaign - {site_name}</title>
    {global_stylesheets}
    [removed][removed]
    [removed]try{Typekit.load();}catch(e){}[removed]
    
    </head>
    <body>
     
      <header>
    <div id="header-hug">
    {embed="global_embeds/logo-area-no-twitter"}
       
       <div class="clearfix"></div>
       <div class="grey-line-top"></div>
       
       <div id="message-small">
        <h1>A wall of a thousand faces. Now that's a message.</h1>
        
       <div class="clearfix"></div>
       </div><!--end message-->
       <div class="grey-line-bottom"></div>
       
    </div><!--end header-hug-->
      </header>
    <div id="page">
      <div id="main" role="main">
     <div id="content">
     
    <div class="slider-left"> 
     
    {exp:safecracker channel="faces" return="submit/thankyou" entry_id="{segment_3}"}
    
    <h2>About your face</h2>
    
    <p>  <br />
     First name<br />
     <br />
     <input  type="text" id="first_name" name="first_name" value="{first_name}" size="50" maxlength="35"  /><br />
     <br />
     Last name<br />
     <br />
     <input  type="text" id="title" name="title" value="{title}" size="50" maxlength="35"  /> <br />
     <br />
     Your email <small>» we will send the odd email alert for new campaigns</small><br />
      <br />
     <input  type="text" id="face_email" name="face_email" value="{face_email}" size="50" maxlength="124"  /> <br />
     <br />
     <br />
     <br />
     Link to profile/website <small>» add a link if you want people to click your face</small><br />
     <br />
     <input type="text" value="http://www." name="face_url" id="face_url" value="{face_url}" maxlength="75" size="50" /> <br />
      <br />
      <br />
     <br />
      </p>
    
    <h2>Upload your face</h2>
    
    <p> </p>
    
    <p>{custom_fields}<br />
     <br />
    {if file}</p>
    
    <p><strong>IMPORTANT: </strong><span>80px by 80px only » jpg/png/gif</span></p>
    
    <p>{display_field}<br />
    {/if}</p>
    
    <p> {/custom_fields}<br />
     </p>
    
    <p>  <br />
     </p>
    
    <h2>Submit your face</h2>
    
    <p> By clicking this button you are committing your support to the AntiSpec campaign.  From time-to-time I will send you a newsletter asking for you to retweet etc. to help spread the message. You are agreeing that the image you upload may be used as deemed appropriate by AntiSpec for reasonable usage for the AntiSpec campaign.  You may have your face removed at anytime by making contact.<br />
     </p>
    
    <p> <br />
     <br />
     {if captcha}<br />
     <br />
     <br />
     <br />
     Please enter the word you see in the image below:</p>
    
    <p> {captcha}</p>
    
    <p> <br />
     <input type="text" name="captcha" value="{captcha_word}" size="20" maxlength="20" /></p><br />
     <br />
     <br />
     <br />
     {/if}<br />
     <br />
     <input type="submit" name="submit" value="submit" /></p><br />
     <br />
     <!--hidden fields--> <br />
      <br />
     <input type="checkbox" name="allow_comments" value="y" {allow_comments} /><br />
      <br />
     <select name="status" id="status"><br />
     {statuses}<br />
     <option value="Pending"{selected}>{status}</option><br />
     {/statuses}<br />
     </select><br />
     </p>
    
    <p>{/exp:safecracker} <br />
    </div><!--end slider-left--></p>
    
    <p><div class="slider-right"></p>
    
    <p> <div class="notice-submit">This website is in live development.  Content is being added and the design is being polished.  Please bear with me.<br />
     Mark<br />
    <small>Updates: <a href="http://www.twitter.com/inspiredmark">@inspiredMark</a> and <a href="https://plus.google.com/112464385220852441782/about">Google+</a></small></div><!--end notice--><br />
    </div><!--end slider-right--></p>
    
    <p> </div><!--end content--><br />
     <br />
      </div><br />
    </div><!--end page--><br />
     <div class="clearfix"></div></p>
    
    <p><br />
    {embed="global_embeds/footer"}<br />
    </body><br />
    </html>

    I did look and yes there was a reference to another version of jQuery. I’ve removed and now I get a broken pop up:

    http://inspr.in/AvFC

    Eeek.

    Any ideas?

    Muchas gracias!

    Mark

  • #6 / Oct 13, 2011 7:44pm

    Dan Decker

    7338 posts

    Hi *Mark*,

    When you say you removed the other version of jQuery, how did you do that? Did you use the SafeCracker parameter to remove it or by removing the script link to jQuery in your html head?

    Cheers,

  • #7 / Oct 17, 2011 8:38am

    *Mark*

    60 posts

    Hi Dan

    I removed the script link from the page altogether.

    Best,
    Mark

  • #8 / Oct 17, 2011 12:22pm

    Mark Bowen

    12637 posts

    Hi Mark,

    Would it be possible for you to update to the latest version 2.3.0 of ExpressionEngine and then try again with a very simplified version of a Safecracker Form and see what results you get. Perhaps also take out all page styling and markup and literally just place in the required Safecracker Form code to the template so that you get it all working in that way and then add back in any styling afterwards to see what is breaking this.

    On a new install of 2.3.0 I’m not able to replicate this problem so hopefully performing an update will help here.

    Thanks,

    Mark

  • #9 / Oct 18, 2011 5:52am

    *Mark*

    60 posts

    Will try Mark. Thank you.

  • #10 / Oct 18, 2011 10:10am

    Mark Bowen

    12637 posts

    Hi Mark,

    No problems. Let us know how you get on.

    Thanks,

    Mark

  • #11 / Oct 26, 2011 4:50am

    *Mark*

    60 posts

    Hello Mark

    We have updated to 2.3.0 and I’ve have stripped everything from the page but the safecracker form:

    http://inspr.in/BHQA

    {html_head}<title></title></head><body>
     
    
    {exp:safecracker channel="faces" return="submit/thankyou" entry_id="{segment_3}"}
    
    <h2>About your face</h2>
    
    <p>  <br />
     First name<br />
     <br />
     <input  type="text" id="first_name" name="first_name" value="{first_name}" size="50" maxlength="35"  /><br />
     <br />
     Last name<br />
     <br />
     <input  type="text" id="title" name="title" value="{title}" size="50" maxlength="35"  /> <br />
     <br />
     Your email <small>» we will send the odd email alert for new campaigns</small><br />
      <br />
     <input  type="text" id="face_email" name="face_email" value="{face_email}" size="50" maxlength="124"  /> <br />
     <br />
     <br />
     <br />
     Link to profile/website <small>» add a link if you want people to click your face</small><br />
     <br />
     <input type="text" value="http://www." name="face_url" id="face_url" value="{face_url}" maxlength="75" size="50" /> <br />
      <br />
      <br />
     <br />
     </p>
    
    <h2>Upload your face</h2>
    <p> <br />
     {custom_fields}<br />
     <br />
     {if checkbox}<br />
     <br />
     {options}<br />
     <label class="checkbox">{option_value}<br />
       <br />
     <input type="checkbox" id="{field_name}" name="{field_name}[]" value="{option_value}"{checked} />{field_data}<br />
       <br />
     </label> <br />
     {/options}  <br />
     <br />
     {/if}<br />
     <br />
     {if file}{file}{/if}<br />
       <br />
     {if simple_s3_uploader}<br />
      <br />
     <br />
     <strong>IMPORTANT: </strong><span>80px by 80px only » jpg/png/gif</span> <br />
     {display_field}  <br />
       <br />
     {/if}<br />
     <br />
     {/custom_fields}</p>
    
    <p>  <br />
     </p>
    
    <h2>Submit your face</h2>
    
    <p> By clicking this button you are committing your support to the AntiSpec campaign.  From time-to-time I will send you a newsletter asking for you to retweet etc. to help spread the message. You are agreeing that the image you upload may be used as deemed appropriate by AntiSpec for reasonable usage for the AntiSpec campaign.  You may have your face removed at anytime by making contact.<br />
     </p>
    
    <p> {if captcha}</p>
    
    <p> Please enter the word you see in the image below:</p>
    
    <p> {captcha}</p>
    
    <p> <br />
     <input type="text" name="captcha" value="{captcha_word}" size="20" maxlength="20" /></p></p>
    
    <p> {/if}<br />
     <br />
     <input type="submit" name="submit" value="submit" /></p><br />
     <br />
     <!--hidden fields--> <br />
      <br />
     <input type="checkbox" name="allow_comments" value="y" {allow_comments} /><br />
      <br />
     <select name="status" id="status"><br />
     {statuses}<br />
     <option value="Pending"{selected}>{status}</option><br />
     {/statuses}<br />
     </select><br />
     </p>
    
    <p>{/exp:safecracker} </p>
    
    <p></body><br />
    </html>

    Any thoughts please?

    Best,
    Mark

  • #12 / Oct 26, 2011 9:50pm

    Dan Decker

    7338 posts

    Hi *Mark*,

    In this version of your form, what file field type are you using? The SafeCracker FIle or Standard File? Is “file” the name of the channel field associated with file uploads? And can we get you change the code back to:

    {if file}
     {display_field}
    {/if}

    or if you are using the SafeCracker File type:

    {if safecracker_file}
     {display_field}
    {/if}

    Cheers,

  • #13 / Oct 28, 2011 4:28am

    *Mark*

    60 posts

    Hey Dan 😊

    I added:

    {if file}
     {display_field}
    {/if}

    I get the file upload link but nothing happens. It just appends a # to the url:

    http://inspr.in/BLqr

    Many thanks,
    Mark

     

  • #14 / Oct 29, 2011 3:52pm

    Dan Decker

    7338 posts

    Hi *Mark*,

    I was unable to duplicate your issue using either the standard file field or the SafeCracker File field. Here is the very basic code I used to test with:

    <!DOCTYPE html>
    <html lang="en">
    
      <head>
        <title>SafeCracker</title>
        <link href="{path="css/_ee_saef_css"}" type="text/css" rel="stylesheet" media="screen">
      </head>
      <body>
        
        {exp:safecracker
          channel="basic-channel"
          return="basic/thanks"
          dynamic_title="[basic-text] Submission"}
        
        
        <label for="basic-text">Enter some text:</label>
        
    
        <input type="text" name="basic-text" value="{basic-text}" />
        
        
        
        <label for="basic-area">Write something nice:</label>
        
    
        <textarea name="basic-area"></textarea>
        
        {custom_fields}
          {if safecracker_file}
          <b>Upload a File:</b>
          
    
            {display_field}
          {/if}
        {/custom_fields}
        
        <input type="submit" value="Submit">
        
        {/exp:safecracker}
        
      </body>
    </html>

    If you make a separate channel with just some basic fields and create a safecracker template with just those basic fields (similar to my test), what are the results?

    I conducted this test on Safari for Mac 5.1.1 and ExpressionEngine 2.3.1

    Cheers,

  • #15 / Nov 01, 2011 5:29am

    *Mark*

    60 posts

    Hey Dan 😊

    Set up a new channel as you mentioned and set up a new template using your code:

    <!DOCTYPE html>
    <html lang="en">
    
      <head>
        <title>SafeCracker</title>
        <link href="{path="css/_ee_saef_css"}" type="text/css" rel="stylesheet" media="screen">
      </head>
      <body>
        
        {exp:safecracker
          channel="faces2"
          return="basic/thanks"
          dynamic_title="[basic-text] Submission"}
        
        
        <label for="test_name">Test name:</label>
        
    
        <input type="text" name="test_name" value="" />
        
        
        
        {custom_fields}
          {if safecracker_file}
          <b>Upload a File:</b>
          
    
            {display_field}
          {/if}
        {/custom_fields}
        
        <input type="submit" value="Submit">
        
        {/exp:safecracker}
        
      </body>
    </html>

    http://inspr.in/BRml

    The output is again missing the file field:

    http://inspr.in/BR5q

    I’ve grabbed the html that is outputted too:

    http://inspr.in/BSEW

    Any ideas please?

    Many thanks,
    Mark

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

ExpressionEngine News!

#eecms, #events, #releases