1

I created a channel:form for creating entries and it works fine. However, when I attempt to edit the content of the entry, the edits don't take and it returns the original entry values.

Edits to the same entry in the Control Panel save fine, so there is something wrong with my form.

Here is the code for the edit entry form:

{exp:channel:form channel="facilities" entry_id="{segment_3}" author_id="CURRENT_USER"  return="test/preview/ENTRY_ID" }

<input type="hidden" id="facilityCounter" value="1" />
 <div id="facilities">
   <fieldset class="facility-info">

    <dl>
    <dt><label>Facility Name*</label></dt>
    <dd class="validate"><input type="text" name="{title}" class="required" value="{title}"></dd>

    <dt><label>Street address*</label></dt>
    <dd class="validate"><input type="text" name="{facility_street_address}" class="required" value="{facility_street_address}"></dd>

    <table class="city-state-zip">
        <thead>
            <tr>
                <th scope="col">City*</th>
                <th scope="col">State*</th>
                <th scope="col">Zip*</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="validate"><input type="text" name="{facility_city}" class="required"  value="{facility_city}"></td>
                <td>
                            <select name="{facility_state}">
                            <option selected value="{facility_state}">{facility_state}</option>
                            <option value="AL">Alabama</option>
                            <option value="AR">Arkansas</option>
                        <option value="FL">Florida</option>
                        <option value="GA">Georgia</option>
                        <option value="KY">Kentucky</option>
                        <option value="LA">Louisiana</option>
                        <option value="MI">Mississippi</option>
                        <option value="NC">North Carolina</option>
                        <option value="SC">South Carolina</option>
                        <option value="VA">Virginia</option>
                     </select>

                </td>
                <td class="validate"><input type="text" name="{facility_zip}" class="zip required" value="{facility_zip}"></td>
            </tr>
        </tbody>
    </table>
    <input type="image" src="/photos/btn_submit-survey.png" alt="" value="Submit">
</div>
</div><!-- end div.facility-form -->

{/exp:channel:form}

I have confirmed permission and do not receive any errors. I would appreciate any insights into why the edits are not saving.

2

1 Answer 1

1

You currently have:

name="{facility_state}"

I think this should be:

name="facility_state"

Same applies to your other fields.

4
  • 1
    To the all-seeing-eye. Thank you! That solved it.
    – forrest
    Sep 2, 2014 at 20:20
  • Follow up question. In the case of checkbox fields with there are two options, yes or no, what should the name="" value be set as? I currently have field_name[], but that is not working.
    – forrest
    Sep 2, 2014 at 20:40
  • Recommend you post this as a separate question.
    – AllInOne
    Sep 2, 2014 at 21:48
  • I posted it here: expressionengine.stackexchange.com/questions/25473/… thanks.
    – forrest
    Sep 3, 2014 at 1:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.