How to generate an automatic ticket number in a text box?