Hi all,
thanks for your help.
This is now solved with putting the code in the success function of the ajax call.
I guess there were a problem with the asynchronous calls somehow. The alert function were executed before the actual ajax call, even tough the ajax code were placed before the alert function.
I dont quite understand this but it's at least working now.
Thanks,
Br
Max