Potresti farlo lato client, prova anche a chiedere sul forum di javascript.