We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Error with missing status field

How Do I?

SChristy's avatar
SChristy
23 posts
9 years ago
SChristy's avatar SChristy

I have a channel form that is trying to create a new entry in a channel. However, I keep getting

The form you submitted contained the following errors

status: This field is required.

In my form, I have a hidden variable names “status” set to “open”. I don’t want to have the user select the status using a dropdown select.

I know that if I go in to the settings for that channel and select a status under the “Channel Form” section, the error goes away (on a side note, even if I choose a default variable of “Open” in the channel defaults and set this to “Use channel defaults”, I still get an error. May be a bug).

However, I would like to know how to set statuses within my forms so I can decide what status to give the new entry based on some template variables.

Here is a simplified form:

{exp:channel:form channel="reporting_questions" include_assets="no" include_jquery="no" return="reporting/settings"}
 <input type="hidden" name="url_title" class="url_title" value="questions_{logged_in_member_id}">
 <input type="hidden" name="title" value="Test title">
 <input type="hidden" name="status" id="status" value="open">
{/exp:channel:form}

Thanks, Steve

       
SChristy's avatar
SChristy
23 posts
9 years ago
SChristy's avatar SChristy

Ahh. I should have read more on the forums. My issue is related to this post - (https://ellislab.com/forums/viewthread/248641/ - “Using form tags within channel tags”). If you are in a channel tag, the “status” variable will not be set correctly (even if in a “no_results” section). However, this leads to another problem. I am using the same form to create new entries and edit existing ones. Using the channel:forms tag, I can’t find a way to do both.

For a new entry, I need to leave “url_title” and “entry_id” empty. However, one of them needs to be included to pull an existing entry to edit. But, if I put one of them in the channel:form tag and the entry doesn’t exist, it complains about not having a valid entry.

So, any ideas? Is it not possible to use the same channel:form tag to either edit or create an entry?

Thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.