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.

Hide localized/fixed dropdown in Safecracker date picker?

October 11, 2012 1:46pm

Subscribe [3]
  • #1 / Oct 11, 2012 1:46pm

    markphillip

    105 posts

    I can’t find how to hide the dropdown (localized / fixed) that magically appears next to my datepicker in my Safecracker SAEF.

    Is this not possible?

    Or can I fix it to localized and just have it hidden?

    It will only confuse the users of my site ... any help would be appreciated!

    P.S.> I have already set the Member Group preference for ‘Allow members to set their own localization preferences?’ to ‘no’.

  • #2 / Oct 14, 2012 9:56am

    Kevin Smith

    4784 posts

    Hi Mark,

    I do see that field in the CP, but I actually don’t see the Fixed/Localized dropdown next to the datepicker when using it in a SafeCracker form. Could you show me the template code you’re using here?

  • #3 / Oct 15, 2012 9:40am

    markphillip

    105 posts

    First off, I should’ve attached a screen shot ... you can see the ‘drop down’ that says ‘fixed’.

    Second, here’s the code ... I’m working with Zoo Visitor

    {exp:channel:entries entry_id="{zoo_visitor_id}" status="not closed" limit="1"}
    {exp:zoo_visitor:update_form return="zoo_visitor_example/profile/success"}
    <fieldset>
     
      <label for="member_firstname">{label:member_firstname}</label>
      <input type="text" name="member_firstname" id="member_firstname" value="{if member_firstname}{member_firstname}{/if}"/>
     
    
     
      <label for="member_lastname">{label:member_lastname}</label>
      <input type="text" name="member_lastname" id="member_lastname" value="{if member_lastname}{member_lastname}{/if}"/>
     
    
     
      <label for="member_birthday">{label:member_birthday}</label>{field:member_birthday}
     
    
     
      <label for="member_gender">{label:member_gender}</label>
      {options:member_gender}
      <input type="radio" id="member_gender" name="member_gender" value="{option_value}"{checked} />{option_value}
      {/options:member_gender}
     
    
    </fieldset>
    
    
     <input type="hidden" name="title" value="{username}">
     <input type="submit" value="Submit" class="button"/>
    
    
    {/exp:zoo_visitor:update_form}
    {/exp:channel:entries}

    field:member_birthday is the Safecracker datepicker field I’m having the issue with.

    Thanks.

     

  • #4 / Oct 16, 2012 11:00am

    Robin Sowell

    13255 posts

    Ah- try this.  Put just that tag on a template, so you’re dealing with something simple.  Then ‘view source’.  Find the source code for the birthday bit.  It will start with <label for=“member_birthday”>.  Copy the code and use that instead of the full tag.  You’ll likely need to put in their birthday default using a variable, but that’s easy.  So you end up with something like

    <label for="my_field_name">Your Custom Field</label>
            <input type="text" name="my_field_name" id="my_field_name" value="{my_field_name}">

    That do the trick?

  • #5 / Oct 16, 2012 2:40pm

    markphillip

    105 posts

    Robin ... it does work in so far as it removes the dropdown ... however, it now renders the date funny in the field.

    Is that what you’re referring to in using a variable to put in the default date?

    If so, any thoughts on what that variable might look like?

  • #6 / Oct 17, 2012 12:16pm

    Kevin Smith

    4784 posts

    Hmm.. ok, so that won’t work. From my understanding, SafeCracker itself doesn’t actually add the fixed/localized drop-down. It seems that Zoo Visitor is adding that drop-down. Have you checked with the folks who make Zoo Visitor to see what they would recommend here?

  • #7 / Oct 18, 2012 4:40pm

    markphillip

    105 posts

    Kevin ... we’ve got a bit of a ‘he said, she said’ thing going on here.

    I inquired with the Zoo Visitor folks and they said that the dropdown is actually part of the native EE datepicker fieldtype ... which would make it an EE thing.

    So, there’s got to be a way to hide it or make it optional, doesn’t there?

    Can you advise further?

  • #8 / Oct 22, 2012 5:05pm

    Dan Decker

    7338 posts

    Hi Mark,

    that the dropdown is actually part of the native EE datepicker fieldtype

    Indeed, it is, in the Control Panel. In SafeCracker (our SafeCracker, not Zoo Visitor) it is not used by default.

    What version of ExpressionEngine, SafeCracker and Visitor are you using?

    As you can see in this screenshot, SafeCracker does not output the localized menu.

    Get me that version info and we’ll see what we can do to help!

    Cheers,

  • #9 / Oct 22, 2012 8:19pm

    markphillip

    105 posts

    Dan ... I’ve changed what I’m doing, so this isn’t an issue any longer. I was going to solve my problem by simply using CSS to hide the dropdown.  It would be nice for there to be an option.

    However ... I do have another sort-of related issue ... I can’t hide the ‘time’ format from the datepicker field ... see the attached screenshot.

    Any input on that?

    This is in a Matrix field that is within a Zoo Visitor field within a Safecracker field.

  • #10 / Oct 23, 2012 5:43pm

    Dan Decker

    7338 posts

    Hi Mark,

    I can’t hide the ‘time’ format from the datepicker field

    Well, entry_date, end_date, and any custom date fields require the time to be part of the value submitted. The time is required because the date/time is converted to a UNIX timestamp before being stored in the database. Without the time, that conversion wouldn’t work.

    I’m sorry I don’t have a good alternative for you.

    ~

  • #11 / Oct 24, 2012 5:13pm

    Noah Kuhn

    60 posts

    EE 2.5.3, SC 2.1

    I’m pretty sure the time format dropdown is automatically created in a safecracker form when using the shorthand field code.

    {field:quote_expected_delivery}

    That is just a simple date field and when it displays, it adds the drop down after the date field. There is seemingly no way to remove it.

    <input type="text" name="quote_expected_delivery" value="" id="quote_expected_delivery" class="field"  />    <select name="field_offset_27" dir="ltr" id="field_offset_27">
    <option value="y">Localized</option>
    <option value="n" selected="selected">Fixed</option>
    </select>
  • #12 / Oct 25, 2012 4:47pm

    Dan Decker

    7338 posts

    Hi Noah,

    Ahh, I see the confusion now - I’ve been using the alternative syntax:

    {exp:safecracker channel='news'}
     Date 
     <input type="text" name="entry_date" value="{entry_date}" maxlength="23" size="25"></p>
    {/exp:safecracker}

    You should be able to use that rather than the short-hand and eliminate the localized menu.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases