How to generate unique id’s in Javascript? I know using uuid in java, but when I used a uuid in JSP, after every refresh it will change to a different id which I don’t want. Also it should not change my id should present like
Suppose if 1,2,3 rows is present with check box
eg:check box and some text fields
if I delete 2 with checkbox it should show 1,3 id’s present, means how much is displaying in jsp page (checkbox with textfields )that much it display id’s.
After adding rows (with checkbox and textfields) the id should be incremented, and the id should be decremented if I delete the rows.
In java script put add row button ,if you press the add row button, it should display your text-box and check-fields (it is present in my example.)how much you press the add-row button it should display the contents (text-box and check-fields) so,
now Actual answer starts, put or declare var in java-script
eg:var rowcount=1;at the end of the fields (means after the last check box and textbox) putrowcount++;in this case if you press the add-row button rowcount will incremented for delete the rows also putrowcount--;(with different function) if you want to delete the rows. After you delete the rows,it will show the id’s how much you deleted if you want (or)it simply delete the rows .This way i found the answer, with this it is possible to use these id’s in jsp with the help ofThanks For everyone, who contribute to answer my question…