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.

Problem with Safecracker File Field

July 26, 2011 1:03pm

Subscribe [3]
  • #1 / Jul 26, 2011 1:03pm

    Clearpeak

    413 posts

    Hi,

    When I use the safecracker file field my other customs fields and title field are frozen, meaning I can’t get my cursor into the inputs. I have applied the July 5 hotfix and I have the latest safecracker files uploaded. This is happening in both safari and FF.

    Here is my template:

    {exp:safecracker channel="portal-shared" return="research-portal/register-success" }
                
                <fieldset>
    
                        <ul>
                
                <li>
                <label for="categories">Categories</label>
    
    <select name="category[]" id="categories" size="4" multiple="multiple">
        {categories}
            <option value="{category_id}"{selected}>{category_name}</option>
        {/categories}
    
    </select>
                </li>
            <li>
            <label for="title">Document Title</label>
            <input type="text" name="title" id="title" value="{title}" maxlength="100" />
            </li>
            
            <li>
            <label for="resources-desc">Document Description</label>
            <input type="text" name="resources-desc" id="resources-desc" value="{resources-desc}" />
            </li>
            
            {custom_fields}
            
            {if safecracker_file}
            {display_field}
    
        {/if}
        
        {/custom_fields}
            
            <input type="submit" value="Submit" />
        {/exp:safecracker}

    Here is the link:

    http://www.pedsresearch.org/research-portal/upload-file

    Running 2.2.1

  • #2 / Jul 26, 2011 1:22pm

    Clearpeak

    413 posts

    I notice if I hard code the Safecracker File Field in than it works:

    {exp:safecracker channel="portal-shared" include_jquery="no" return="research-portal/register-success" }
                
                <fieldset>
    
                        <ul>
                
                <li>
                <label class="input-title" for="categories">Categories</label>
    
    <select name="category[]" id="categories" size="4" multiple="multiple">
        {categories}
            <option value="{category_id}"{selected}>{category_name}</option>
        {/categories}
    
    </select>
                </li>
            <li>
            <label class="input-title" for="title">Document Title</label>
            <input type="text" name="title" id="title" class="text-input" value="{title}" maxlength="100" />
            </li>
            
            <li>
            <label class="input-title" for="resources-desc">Document Description</label>
            <input type="text" name="resources-desc" class="text-input" id="resources-desc" value="{resources-desc}" />
            </li>
            
            
    <input type="hidden" name="resources-sc_hidden" value="" />
    
    <input type="hidden" name="resources-sc" value="NULL" />
    <li>
            <label class="input-title" for="resources-desc">Upload File</label>
    
        <input type="file" class="text-input"name="resources-sc" value=""  />
    
    </li>
        
            
            <li>
    
                                <button type="submit" id="reg_register" class="btn">Login</button>
    
                            </li>
        {/exp:safecracker}
  • #3 / Jul 26, 2011 1:32pm

    Brooks Seymore

    106 posts

    In your first example, where you currently have

    {custom_fields}
        {if safecracker_file}
          {display_field}
        {/if}
      {/custom_fields}

    Try replacing that entire block with just

    {field:custom_field_name}
  • #4 / Jul 26, 2011 1:37pm

    Clearpeak

    413 posts

    Thanks but same issue.  Can’t use the other fields.

  • #5 / Jul 26, 2011 2:27pm

    Brooks Seymore

    106 posts

    I ran your code through the W3 Validator and there are six errors which you should go ahead and fix. One of which involves an missing <fieldset> start tag.

    http://validator.w3.org/

    I wouldn’t be surprised if after fixing those errors, your issue with the other fields is resolved.

    That said, all I can see on your page is the Upload a File header, not the form or even any other sign that you have a form on that page.

  • #6 / Jul 27, 2011 4:23am

    John Henry Donovan

    12339 posts

    fodney,

    After adding that patch did you go into your Output and debugging prefs and save them again?
    Make sure your config file has permissions of 666 and that the following is set

    $config['debug'] = "1";

    You are already including jQuery on your page so exclude it from your form

    {exp:safecracker channel="portal-shared" return="research-portal/register-success" include_jquery="no"}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases