I have a generate id button, when I click on the button it generates the date '2013-06-13' in a textbox. I want to add a 4 digit counter to the end of it so it will look like this '2013-06-13-xxxx' (0001, 0002, etc). When I click on the the generate button I want it to show '2013-06-13-0001' then I will push a submit button and the form will reset. When I push the generate id button again I want it to show '2013-06-13-0002' what code may I use to do this?
var counter = 0000;
function Counter() {
if((document.getElementById("generateid").clicked == true)
{
Counter++
return counter;
}
}
This is the output code
function guidGenerator() {
var theID = (Year() + "-" + Month() + "-" + Day() + "-" + Counter);
return theID;
}