Drag & Drop with parameter

1

I'm doing a dynamic form. Where has a button that adds the type of the field (Date, Time, Text, Email, etc). And I wanted to sort those fields with drag and drop. I would need to return the position of the fields, as I will save the order, type and values in a bank.

The user will be able to create several types of forms, with the fields that he wants, and then, at the time of listing, would have to display the fields in the order he left with drag and drop.

Currently my code is already creating the fields, and saving in the database. But without the possibility of user ordering. Then I would have to add another column in the DB to know the position that the plugin returns.

Does anyone know of a plugin that does something like this?

The plugins I found so far, form build did not show the position of the fields.

    
asked by anonymous 19.10.2015 / 19:09

1 answer

0

JQuery itself can sort the elements with Draggable. Here's an example of the functionality:

link

Then you get a list of the elements and send them backend. It will already be sorted in the html with Draggable, so you can send the position according to the css / xpath field, picking up the number of the element it is

    
19.10.2015 / 22:57