Ok, What I think is happening is that you click submit and that is a POST, and the reload is a GET.
For POST requests, the param("id") function will return the parameters from the postdata, but any parameters specified via a query string in the URL is available from the url_param("id"). Maybe you have a FORM that also has the id, or defines it, and it's empty?
For GET requests, when you reload the page, CGI parses the specified parameters and makes them available via the param() method.
So try url_param("id")