Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello,

so I have a page where users can basically submit tickets through a databound form (create mode).

On a different page, all the tickets are displayed within a table, like this (simplified):

Code: Select all
<tbody>
<cms:pages masterpage='formular.php'>
<tr>
   <td class ="listing" id="<cms:show 'status_'/><cms:show k_page_id />">
      <cms:input name='status' type='dropdown' opt_values='open|okay|okayMGMT|rejected|on hold' opt_selected="<cms:show status />" />
   </td>

   <td class ="listing">
      <cms:show tickettype />
   </td>
   <td class ="listing">
      <cms:show date />
   </td>
   <td class ="listing">
      <cms:show name />
   </td>
   <td class ="listing">
      <cms:show team />
   </td>
   <td class ="listing">
      <button type="submit" name="submit" onclick="ticketedit();">Save</button>
   </td>
</tr>
</cms:pages>
</tbody>


I need to be able to change certain values within the ticket (in the example, the dropdown value) and save the changes to the ticket (databound edit mode). It's almost the same idea as in the advanced tutorial, but I want to skip the tickets having their own page view. I want to do everything from list view.

Originally I tried to put a <cms:form> databound tag inside the pages tag in the table (so basically have a separate form to edit a ticket in each table row), but this doesn't work because forms are not allowed to be in tables. So my new idea was to have the form outside the table and use javascript/jquery to populate the form once I press the button. My plan is to basically just copy the values from my table row into the form, pass along the k_page_id of that specific row and then submit it.

My problem now is, that couch requires me to provide a page id for the edit mode form right from the start. I can't just pass the correct page_id to the form later, or at least I wouldn't know how. Any suggestions?
A form is not allowed to be a child element of a table, tbody or tr. You can have a form inside a table cell.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
You are right, thanks a ton! I managed to hack my form together now :)
3 posts Page 1 of 1