If you have a field unid which is editable and has type=hidden in the html other properties you can access the value using javascript:
alert( window.document.forms[0].unid.value );
If the field has the defautl value of:
@Text(@DocumentUniqueID)
This is a nice way of beign able to access the unid in javascript for building pop up urls on the fly etc.
One problem with this technique is that the values is saved on a submit and in this case the unid changes.
The unid will then be wrong .
An easy way around this is to stick in the input translation event:
@Text(@DocumentUniqueID)
This will then be updated when the document is saved ready for when the document is read or edited again.
NB Might be worth putting a comment in the default value field as developers do not assume Input Translation is used on the web:
REM {updated on save in input ttranslation event};
@Text(@DocumentUniqueID)
I found this useful, hope you do too. If you have any ideas how else this can be used @username, @userroles etc let me know.