I\'m using jQuery to post a form to a php file, simple script to verify user details.
var emailval = $(\"#email\").val();
var invoiceIdval = $(\"#invoiceId\"
I tried the given function from Owen but got a blank alert as well. Strange but i noticed it would output a query string and return a blank alert. Then i'd submit again and it would alert with correct post values.
Also had the field names set in the html using the id attribute (which was how it was done in a jquery tutorial I was following). This didn't allow my form fields to serialize. When I switched the id's to name, it solved my problem.
I ended up going with $.ajax after all that since it did what I was looking for.