Dynamic add rows inside of create new entry modal

Dynamic add rows inside of create new entry modal

randy.johnsonrandy.johnson Posts: 18Questions: 8Answers: 0
edited January 2016 in Editor

https://db.tt/xUw2Y7TA

I use this: $('body').on('show.bs.modal','.modal', function (e) {}

to add the add / delete "Position in Bin Location" rows you see in the screenshot.

The functionality works great but when I click create only the first "Position in Bin Location" value submits with the form.

I tried changing the id for each of the rows before submit and that did not help.

<input id="DTE_Field_warehouse_bin_location_positions[]-strWarehouseBinLocationPosition1" type="text" class="form-control">
<input id="DTE_Field_warehouse_bin_location_positions[]-strWarehouseBinLocationPosition2" type="text" class="form-control">
<input id="DTE_Field_warehouse_bin_location_positions[]-strWarehouseBinLocationPosition3" type="text" class="form-control">

and

<input id="DTE_Field_warehouse_bin_location_positions1[]-strWarehouseBinLocationPosition" type="text" class="form-control">
<input id="DTE_Field_warehouse_bin_location_positions2[]-strWarehouseBinLocationPosition" type="text" class="form-control">
<input id="DTE_Field_warehouse_bin_location_positions3[]-strWarehouseBinLocationPosition" type="text" class="form-control">

seeing if I could just get the values to submit but no luck.

I am kind of at a loss of where to go next. Is this something I can do using editor?

Thanks,

Randy

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Is this a custom field type input you are using, or are you modifying a built in field type with your event handler? The problem with the latter is that it is pre-programmed to assume there is only one field and its get / set methods will always just get / set that value.

    For more complex inputs such as this I would suggest using a custom plug-in field type which you can configure to correctly handle the multiple values.

    Allan

  • randy.johnsonrandy.johnson Posts: 18Questions: 8Answers: 0

    ok custom plug-in field type it is. I will give it a whirl.

    Thank You,

    Randy

This discussion has been closed.