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.

Whats wrong with this code?

June 30, 2014 3:29pm

Subscribe [1]
  • #1 / Jun 30, 2014 3:29pm

    Riverboy

    2993 posts

    I get almost same channel:form set working in other server, but this wont let me delete file when editing entry.

    Ideas from where I try to look for solution? (sorry about messy code, hehe)

    {if logged_in}
    {exp:channel:entries channel="my_events" limit="1" entry_id="{segment_3}"} 
    {exp:channel:form channel="my_events" 
    return="events/detail-info/{url_title}"  
    author_only="yes" 
    cache="no" 
    datepicker="no" 
    require_entry="yes" 
    entry_id="{segment_3}"}
    
                    <label><h3>* Event name</h3><p></label><input type="text" name="title" value="{title}" /></p></p>
    
    <p><label for="url_title">URL title</label><br />
    <input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50"></p>
    
    <p><br />
                  <br />
            <label for="categories"></p><h3>Sijainti</h3><p></label><br />
            <select name="category[]" id="categories" size="4" multiple="multiple"><br />
      {exp:channel:categories channel="my_events" category_group="1" show_empty="yes" style="linear"}<br />
     <option value="{category_id}"{selected}>{category_name}</option><br />
    {/exp:channel:categories}<br />
    </select> </p>
    
    <p>                    <label></p><h3>Banner</h3><p></label>{custom_fields}  {if file}{display_field} {/if}{/custom_fields}</p>
    
    <p><label></p><h3>Details</h3><p></label><textarea name="event_details" rows="{rows}">{event_details}</textarea></p></p>
    
    <p>               <label></p><h3>Price</h3><p></label><input type="text" name="event_cost" value="{event_cost}" /></p>
    
    <p><label></p><h3>Event by</h3><p></label><input type="text" name="event_host" value="{event_host}" /></p></p>
    
    
    
    <p><br />
                    </p>
    
    <p>                <input type="submit" name="submit" value="update now?" /></p><br />
                {/exp:channel:form}<br />
    {/exp:channel:entries}</p>
    
    <p>{/if}

    This is the part that doesnt work, even what I have tried, it just shows the thumb but when clicking X, it hits me back to top of the page ie foo/bar#

    <label><h3>Banner</h3></label>{custom_fields}  {if file}{display_field} {/if}{/custom_fields}

    I have the css on meta, i have stripped out almost everything (even that form above is not the actual full form code), but cant figure out why it wont let me edit the file /remove it and upload new one..

    So ideas. It has to be some sort of JS issue?

  • #2 / Jun 30, 2014 6:43pm

    Green Egg Media

    111 posts

    Does the mark-up that is generated look correct? It definitely sounds like the click action is not being handled correctly, which would indicate that the JS is not functioning correctly. Have you tested it using Inspector in either Chrome or Firefox to see if any errors are being generated?

  • #3 / Jul 01, 2014 5:47am

    Riverboy

    2993 posts

    I looked at the source code when going to actual editing page, and there is all as should be. At least I think so. But it wont pull all visible :/ thats odd.

    Inspector shooted out this error:

    Uncaught TypeError: Cannot read property ‘date_format’ of undefined

    I now try to modify both forms, actual form and the editing form and see if this is some odd-way related to using date fieldtypes and file fieldtype. Even that I do not think there should be any problem using those together.

  • #4 / Jul 01, 2014 6:21am

    Riverboy

    2993 posts

    Hmhm. At least first test didnt have any issues anymore after I removed 2 date fieldtypes from forms. Now the file removing and re-uploading worked just fine.

    So, there might be some sort of a bug if using 2 date fields w/ file field. Or it was on my codes…(as it usually has been hehehe)

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

ExpressionEngine News!

#eecms, #events, #releases