Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I changed around the auto.js file so it is as follows. Seems to work fine.</p> <pre><code>var listItemCounter = 0; $("#addList").click(function() { listItemCounter++; var text = $("#inputList").val(); //assign a unique id number to this button, so it knows which hidden field to remove when clicked var buttonDataId = text + '&lt;button data-id="' + listItemCounter + '"&gt;x&lt;/button&gt;'; if(text.length){ $('&lt;li /&gt;', {html: buttonDataId}).appendTo('ul.featureList'); $('&lt;input type="hidden" name="features[]" value="' + text + '" data-id="' + listItemCounter + '" /&gt;').insertAfter('ul.featureList'); }; }); $('ul').on('click','button', function(el){ $('input[data-id="' + $(this).attr('data-id') + '"]').remove();//remove the hidden field so it does not get POSTed when user saves $(this).parent().remove() }); </code></pre> <p>I left the view the same as what Jordan Lev put. (Thanks!) Then I changed the controller.php to</p> <p><code>public function save($args) { $args['features'] = implode("\n", $args['features']);//combine all feature items into one string, separated by "newline" characters parent::save($args); }</code></p> <p>If anyone sees any problems or a better way to put my code please let me know! My new problem now is once it is saved, if I go to edit the list, it wipes out my past entries and saves the new one. If anyone knows the function I would have to write to show the current list and add to it when editing that would be great. Please give some example code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload