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.

safecracker .. Wierd issue

March 28, 2011 5:37am

Subscribe [2]
  • #1 / Mar 28, 2011 5:37am

    sajwal

    52 posts

    Hi,
    I am not sure i would be able to explain this…but i will try my level best…


    It’s a wierd issue i am facing with Safecracker….
    I had a form for People entries .... it worked all good.

    Now I added some more fields to that channel - People,  like CUSTOM FIELD - {address} ....
    and if i go to Safecracker to add / modify People

    it shows all the previous fields good but the newly added have the {braces} in the text field which gets uploaded on submit

    I am attaching a picture for better understanding.

  • #2 / Mar 28, 2011 1:18pm

    Sue Crocker

    26054 posts

    Hi, sajwal. I saw something similar the other day.. are you listing each field by itself? Can you post your form?

  • #3 / Mar 29, 2011 4:24am

    sajwal

    52 posts

    Thanks for the help sue,...here is the form…I think its not related to safecracker…its something to do with EE ..or some database structural changes that happened…i checked migrating the entire site to a different server .. no go…tried installing the latest EE build ... no go…reinstalled Saefcracker…no go…!!!!

    {exp:safecracker channel="people" return="saef/people/{segment_3}" entry_id="{segment_3}"}
        <table width="98%" border="0" align="center" cellpadding="2" cellspacing="2">
      <tr>
        <td width="25%" valign="top">Famous People        
    
          <input type="text" name="title" id="title" value="{title}" size="40" maxlength="100">
          
    
        Real Name :
          <input type="text" name="realname" id="realname" value="{realname}" maxlength="100" size="40" />    </td>
        <td width="27%" valign="top">Title URL :   
    
            <input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="40" />
            
    
          Entry Date : 
          <input type="text" name="entry_date" id="entry_date" value="{entry_date}" maxlength="23" size="23" />    </td>
        <td width="26%" valign="top">Birth Date  : 
    
          <input type="text" name="birthdate" id="birthdate" value="{birthdate}" maxlength="23" size="23" />
          
     
          Birth Place
    
    
    <input type="text" name="birthplace" id="birthplace" value="{birthplace}" maxlength="75" size="40" />
    
    </td>
        <td width="22%" valign="top">Died On  : 
    
          <input type="text" name="died" id="died" value="{died}" maxlength="23" size="23" />
          
    
    Death Place 
    
    <input type="text" name="deathplace" id="deathplace" value="{deathplace}" maxlength="23" size="23" /></td>
      </tr>
      
      <tr>
        <td colspan="4" valign="top"><strong>Proffession :</strong>
              • {categories group_id="2" order_by="category_name"}
              <label><input type="checkbox" name="category[]" value="{category_id}" {checked} />{category_name}</label>
     • {/categories} </td>
        </tr>
      <tr>
        <td colspan="4" valign="top"><input name="status" type="hidden" value="Open"/><input type="submit" name="submit" value="Submit" ></td>
      </tr>
    </table>
     {/exp:safecracker}
  • #4 / Mar 29, 2011 5:26pm

    Sue Crocker

    26054 posts

    Let’s have you do the following: Use the {custom_fields} loop to grab your text fields.

    {custom_fields} 
        <div><label for="{field_name}">{if required}* {/if}{field_label}</label> 
    
        
        <div>{field_instructions}</div>
        
        {if error} {error} {/if} 
    
     {if text}
            <input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" />
        {/if}
    {/custom_fields}

    Does that make a difference?

  • #5 / Mar 31, 2011 12:33am

    sajwal

    52 posts

    I am sure there is some problem related to EE….
    In EE form i don’t see the {deathplace} but in saefcracker i do…

    My code now is

    {exp:safecracker channel="people" return="saef/people/{segment_3}" entry_id="{segment_3}"}
        <table width="98%" border="0" align="center" cellpadding="2" cellspacing="2">
      <tr>
        <td width="25%" valign="top">People Title :        
    
          <input type="text" name="title" id="title" value="{title}" size="40" maxlength="100">
          
    
          <span class="style1">Real Name : </span>
          <input type="text" name="realname" id="realname" value="{realname}" maxlength="100" size="40" />    </td>
        <td width="27%" valign="top">Title URL :   
    
            <input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="40" />
          
          
    </td>
        <td width="26%" valign="top">      Birth Place
    
    
    <input type="text" name="birthplace" id="birthplace" value="{birthplace}" maxlength="75" size="40" />
    
    </td>
        <td width="22%" valign="top"> Death Place 
    
    <input type="text" name="deathplace" id="deathplace" value="{deathplace}" maxlength="23" size="23" /></td>
      </tr>
      
      <tr>
    
    
      </tr>
      <tr>
        <td colspan="4" valign="top">{custom_fields} 
        <div>      
        {if error} {error}{/if} 
            <input type="text" dir="ltr" id="{deathplace}" name="{deathplace}" value="{deathplace}" maxlength="20" size="50" />
     {/custom_fields}</td>
      </tr>
      <tr>
        <td colspan="4" valign="top"> </td>
        </tr>
      <tr>
        <td colspan="4" valign="top"><input name="status" type="hidden" value="Open"/><input type="submit" name="submit" value="Submit" ></td>
      </tr>
    </table>
     {/exp:safecracker}

    ...the output is a series of {deathplace} in a col in line…attached image is the screeshot

  • #6 / Mar 31, 2011 7:59am

    Sue Crocker

    26054 posts

    I see a closing {/custom_fields} tag, but not an opening {custom_fields} loop..

  • #7 / Apr 01, 2011 10:26am

    sajwal

    52 posts

    {exp:safecracker channel="people" return="saef/people/{segment_3}” entry_id=”{segment_3}”}
      <table width=“98%” border=“0” align=“center” cellpadding=“2” cellspacing=“2”>
      <tr>
      <td width=“25%” valign=“top”>People Title :     

        <input type=“text” name=“title” id=“title” value=”{title}” size=“40” maxlength=“100”>
       

        Real Name :
        <input type=“text” name=“realname” id=“realname” value=”{realname}” maxlength=“100” size=“40” />  </td>
      <td width=“27%” valign=“top”>Title URL : 

          <input type=“text” name=“url_title” id=“url_title” value=”{url_title}” maxlength=“75” size=“40” />
       
       
    </td>
      <td width=“26%” valign=“top”>    Birth Place


    <input type=“text” name=“birthplace” id=“birthplace” value=”{birthplace}” maxlength=“75” size=“40” />

    </td>
      <td width=“22%” valign=“top”> Death Place

    <input type=“text” name=“deathplace” id=“deathplace” value=”{deathplace}” maxlength=“23” size=“23” /></td>
      </tr>
     
      <tr>


      </tr>
      <tr>
      <td colspan=“4” valign=“top”>{custom_fields}
      <div>   
      {if error} {error}{/if}
          <input type=“text” dir=“ltr” id=”{deathplace}” name=”{deathplace}” value=”{deathplace}” maxlength=“20” size=“50” />
    {/custom_fields}</td>
      </tr>
      <tr>
      <td colspan=“4” valign=“top”> </td>
      </tr>
      <tr>
      <td colspan=“4” valign=“top”><input name=“status” type=“hidden” value=“Open”/><input type=“submit” name=“submit” value=“Submit” ></td>
      </tr>
    </table>
    {/exp:safecracker}

  • #8 / Apr 01, 2011 2:15pm

    Sue Crocker

    26054 posts

    sajwal:

    Even simpler than that.

    {sc_css}
    
    <h3>Sample SafeCracker Form</h3>
    <p>{exp:safecracker channel="people" return=“saef/people/ENTRY_ID" entry_id="{segment_3}"}<br />
        <label for="title">Title</label></p>
    
    <p>    <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100"><br />
      </p>
    
    <p><br />
        <label for="url_title">URL Title</label></p>
    
    <p>    <input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50" /><br />
      </p>
    
    <p><br />
     <hr ><br />
    <div></p>
    
    
    
    <p>{custom_fields} <br />
        <div><label for="{field_name}">{if required}* {/if}{field_label}</label> </p>
    
    <p>    <br />
        {if field_instructions}<br />
        <div>{field_instructions}<br />
    </div><br />
        {if:else}<br />
        <div>Fill in the field!</div><br />
        {/if}<br />
        {if error} {error} {/if} </p>
    
    <p> {if text}<br />
            <div><input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" /></div><br />
        {/if}<br />
      <br />
        <br />
        {if textarea} <br />
           <div> <textarea id="{field_name}" name="{field_name}" dir="{text_direction}" rows="{rows}" cols="70">{field_data}</textarea> </div><br />
           <br />
        {/if} <br />
    {if date}<br />
            <input type="text" id="{field_name}" name="{field_name}" value="{field_data}" size="50" /><br />
        {/if}</p>
    
    <p><br />
       </div> <br />
      <br />
    {/custom_fields}  </p>
    
    <p><br />
        <div><input type="submit" name="submit" value="Submit" /></div></p>
    
    <p>{/exp:safecracker}

  • #9 / Apr 01, 2011 2:19pm

    Lisa Wess

    20502 posts

    Hi, sajwal -

    What type of custom field are you using?

    In your original form code, can you try using:

    {field:your_custom_field_name}

    replacing your_custom_field with the shortname for your custom field?  Try that instead of the hidden inputs; let’s see if that works.

    Also, do you have that template cached at all?

    Lastly, please include what version of EE and SafeCracker you are running.

    Thanks!

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

ExpressionEngine News!

#eecms, #events, #releases