Hello,
  I have a requirement wherein the UI needs dynamic addition of
records into a <ul> list. Basically the requirement is something like
this http://devblog.jasonhuck.com/assets/infiniteformrows.html
But this is not index based, rather it is just navigating the dom by
parent reference.

However I needed a indexed multiple entry block to keep the code
cleaner.

My approach was to keep a HTML attribute index and on event (like add
button click) fetch all the elements with the id, then filter out
using the attribute "index". This gives me a handle to the element.

I tried making the id attribute as <input id="myid[index]"/> , but
unfortunately I am not able to dynamically navigate to the index $
('#myid\\['+index+'\\]') . The problem basically was with escaping
brackets [ ]  which I couldn't find a solution for.

Hence my alternative was to use an attribute "index" into the HTML
element dynamically like this <input id="myid" index="1"/>

Looked around but couldn't find a good solution.In vain.
This is a common requirement but I am not able to get the best
practice for building such a thing.

Thanks for your time and help.
S

Reply via email to