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 Issue with "number" field

April 04, 2012 5:29pm

Subscribe [2]
  • #1 / Apr 04, 2012 5:29pm

    Steve Abraham

    149 posts

    I’m hitting on a strange issue with “number” fields (text fields set to restrict content to numbers) when used in Safecracker forms.

    If I put a large number into the field, e.g. a million (1000000), the correct value is shown OK when outputting the entry using EE tags, but if I then use safecracker to *edit* the entry, the 1 million shows up as “1e+06”.

    http://cl.ly/1N2h1D1t0a1P0l3b0o3U

    Any ideas?

  • #2 / Apr 05, 2012 1:39pm

    Dan Decker

    7338 posts

    Hi Steve,

    That is odd. What is presented when you view the number/field via the Control Panel?

    Can you share your SafeCracker template and your ExpressionEngine version with me?

    Cheers,

  • #3 / Apr 05, 2012 4:00pm

    Steve Abraham

    149 posts

    Hi Dan,

    Number is shown correctly when viewed in the Control Panel.

    EE is bang up to date, latest version from the download page.

    Safecracker form is as follows:

    {exp:safecracker channel="ads" return="account" url_title="{segment_3}" include_jquery="no"}
    
    <input name="title" value="Edit Ad" type="hidden">
    
    {custom_fields}
    
    {if textarea}
    {field_label}<br>
    <textarea class="txts" name="{field_name}" id="{field_name}">{field_data}</textarea></p>
    {/if}
    
    {if text}
    {field_label}<br>
    {if field_name=="ad_price"}£ {/if}<input type="text" name="{field_name}" id="{field_name}" value="{field_data}" class="txt"></p>
    {/if}
    
    {if safecracker_file}
    {if field_name=="ad_photo_1"}Advert Photos{/if}
    {display_field}
    {/if}
    
    {if multiselect}
    {field_label}<br>
    <select id="{field_name}" name="{field_name}[]">
    {options}
    <option value="{option_value}"{selected}>{option_name}</option>
    {/options}
    </select>
    {/if}
    
    {/custom_fields}
    
    <input type="submit" value="Update Ad"></p>
    
    {/exp:safecracker}

    Thanks!

  • #4 / Apr 06, 2012 5:58pm

    Shane Eckert

    7174 posts

    Hey Steve Abraham,

    I was able to reproduce this.

    I have a filed a Bug.

    Thanks for finding and reporting this.

    Please comment on the bug to subscribe to the updates.

    Have a great weekend!

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases