Ajax submission ggeneric function