The script works but it is only writing to the current page, using document.write().
I assume the ' + "" + ' parts are for literals; at present, they could be removed totally.
There is no need for the variable stampmonths either, all it is doing is incrementing the month number and padding it to two digits.
On any given day, the code could repeat every time the minute comes round, that is 1,440 times a day are one chance in sixty.

For uniqueness all you need is:
Code:
<script>
Code:
var d = new Date();
var n = d.getTime();
</script>
To render to the current document, you would include document.write(n); just before </script>.

Variable d will update every time the page/form is opened or refreshed. Once the form is submitted, it is locked.

To add it to a CoffeeCup form, you need to associate the value of the variable d to an input or other field name.
To help here, I need an example of the form you have built. I have assumed you do not have CoffeeCup's
Shopping Cart Designer Pro.

Acorn