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 - PullDowns Do Not Operate Same As Using The CP Publish Form

March 22, 2011 6:26pm

Subscribe [2]
  • #1 / Mar 22, 2011 6:26pm

    genehil

    23 posts

    I’ve got several (33) pulldowns that have the following as options to be selected:

    n/a
    1
    2
    3
    4
    5

    If I submit a record using the PUBLISH action from inside the CP - each of my pulldowns display the “n/a” as the default option… and any of the pulldowns that I do not alter - all end up submitting the “n/a” into a new record… which is fine with me. I’ve based other template options to “look for” the “n/a” and then display something else in it’s place.

    However, if I use the SAEF to submit a record - all of the same pulldowns in the SAEF do not display the “n/a” option.  If I just hit the submit button on my SAEF - any of my pulldowns that were left at their SAEF default settings fail to put their “n/a”(s) into the record and my output that depends on the “n/a”(s) does not display properly.

    Below is my SAEF code for my pulldowns:

    {if pulldown}
    <select id="{field_name}" name="{field_name}">
    
    
    {options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
    
    </select>
    {/if}

    I’m wondering if anyone can help me get my SAEF pulldowns to display and accept their “n/a” option by default without having to go to each and every one when using the SAEF and manually selecting the “n/a” option… and still have the option to manually select on of the other options, if I need to.

    EE Version 1.6.9 (going to 1.7.0 very soon)

    ADDITIONAL INFO:  If I submit a record via SAEF and that record displays improperly on my site - because none of the default “n/a”(s) are in the fields I made no changes to… I can log into the CP - call that particular record up for EDIT - and do nothing other than click the UPDATE button - the record will now display properly - because the UPDATE action from within the CP “forced” the default “n/a”(s) into their respective fields.

  • #2 / Mar 23, 2011 12:05pm

    Sue Crocker

    26054 posts

    Hi, Gene.

    What I’d do is manually add a line like this:

    <option value=“n/a” selected>n/a</option> right before the {options} loop. Does that help?

  • #3 / Mar 23, 2011 12:20pm

    genehil

    23 posts

    Perfect, Sue…

    I just had to remove the quotes from the value= part:
    <option value=n/a selected>n/a</option>

    It did what I needed it to do. Thanks!!!

  • #4 / Mar 23, 2011 12:23pm

    Sue Crocker

    26054 posts

    Cool! Glad that helped. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases