Define faq:
<div id="faq">
<div id="q1">...</div>
<div id="q2">...</div>
(...)
<div id="q100">..</div>
</div>
Make faq sortable:
<script type="text/javascript">
$("#faq").sortable();
</script>
Presented form:
<form action="..." id="faq_form">
<input type="hidden" name="faqs" id="faqs" />
...
</form>
Add a sorted sequence to form
<script type="text/javascript>
$("
$("#faqs").val($("#faq").sortable('toArray'))
})
</script>
When the form is submitted, the "faqs" field will contain the identifier, separated by a comma, from #faq as follows: q1, q3, q10, q11, q2, Q100 ...
Just analyze it and save to DB
source
share