It should be quite easy to write a Javascript function which takes a
string as a parameter and returns that same string, with zeroes appended at the left to make the length up to 8. Are you asking how to do that? Or how to get something to call that function? Don't know how to get it called at the right time? Or where to put the result?
So I guess, no, I don't really understand the question.