Ok try this, open /templates/<yourtemplate>/member_uploadform.html
Find:
<input type="hidden" name="cat_id" value="{cat_id}" />
Replace with:
{if cat_id}<input type="hidden" name="cat_id" value="{cat_id}" />{endif cat_id}
Of course any javascript that you are using I can not help on as I do not know javascript, but if you can at least get the uploadform working then javascript would not be needed, unless you wanted to try to add that as a second option.