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

Channel:form errors when submitting form

How Do I?

Ace Prod's avatar
Ace Prod
111 posts
10 years ago
Ace Prod's avatar Ace Prod

Hi,

I may be overlooking something simple here but every time I submit a channel:form I’m having the error

The form you submitted contained the following errors Your channel entry must have a title. Unable to create valid URL Title for your entry

Here’s my code

{exp:channel:form channel="test" return="test/thank-you"include_jquery="no"error_handling="inline"logged_out_member_id="3"}

<div class="news-field">
 <dl class="last">
  <dt>Title:  <sup>*</sup></dt>
  <dd><input type="text" class="required" id="title" name="title" value="" size="50" maxlength="100">
        <input type="hidden" class="required" id="title" name="title" value=""></dd>
 </dl>
</div>
<div class="news-field">
 <dl class="last">
  <dt>Description:  <sup>*</sup></dt>
  <dd><input type="text" class="required" id="test-description" name="test-description" value="" size="50" maxlength="100">
        </dd>
 </dl>
</div>

<div class="news-field">
 <input type="file" name="test" id="test" class="required" />
 <input type="hidden" name="status" id="status" value="pending" />
 <input type="submit" name="submit" value="send form" >
</div>

{/exp:channel:form}

I can’t see where I’m going wrong. Have I over looked something?

Thanks Chris

       
jay_turley's avatar
jay_turley
46 posts
10 years ago
jay_turley's avatar jay_turley
<dd><input type="text" class="required" id="title" name="title" value="" size="50" maxlength="100">
        <input type="hidden" class="required" id="title" name="title" value=""></dd>

I haven’t worked with channel forms yet, but you have two inputs with the same name and id for title. And the second one will ensure title is always blank. Which should generate the “need a title” error.

       
Ace Prod's avatar
Ace Prod
111 posts
10 years ago
Ace Prod's avatar Ace Prod

Thanks Jay, I was working form a example on the EE docs however when I remove the blank input I get the same response?

       
Podzol's avatar
Podzol
80 posts
10 years ago
Podzol's avatar Podzol

I would only put one input for the entry title in each form.

Try this for the value parameter, whether you choose the type=”input” or type=”hidden”:

value="{title}"

If you use the type=hidden parameter on a new entry, I suspect that you will get the same error because ee won’t know how to populate the {title} field. I only use the hidden input parameter for editing existing entries.

I hope that helps.

       
fsdiasjfiowe's avatar
fsdiasjfiowe
3 posts
10 years ago
fsdiasjfiowe's avatar fsdiasjfiowe
I would only put one input for the entry title in each form. Try this for the value parameter, whether you choose the type=”input” or type=”hidden”:
value="{title}"
If you use the type=hidden parameter on a new entry, I suspect that you will get the same error because ee won’t know how to populate the {title} field. I only use the hidden input parameter for editing existing entries. I hope that helps.

yeah, maybe it can help you.

       

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.