What I am trying to do is have a repeating section that has an ID # assigned to it. The way it works now is that I have an ID field which is assigned a value from an ID Iterator field that is incremented each time a new section is added. Pretty standard.
The next thing I added to this form was the ability to move each section using the following code and stuff. I have two buttons, one to move the section up and one to move it down. As you can see from the code, it just performs a simple insert after/before for moving. The problem is that each time the form re-inserts the section, it is assigned a new ID # because the form thinks it is a new section.
What I need help with is how to keep the ID # static. Any help will be appreciated.
Up/Down button code (VBScript found from googling):
Sub CTRL27_11_OnClick(eventObj)
Dim oItem, oParent, oPrevious
Set oItem = eventObj.Source
Set oParent = oItem.parentNode
Set oPrevious = oItem.previousSibling
If Not (oPrevious Is Nothing) Then
oParent.removeChild oItem
oParent.insertBefore oItem, oPrevious
End If
End Sub
Thanks again.