Topic: Getting the status code for a hidden input

Does anyone know if there's a way to set the status code in the http request in to a hidden input in HTML without resorting to Ruby (or another server-side dependency)? Javascript perhaps?

For a bit more background info; I'm working on an app that provides an installation code (for error pages) which is copy/pasted in to a client site. It needs to set the status code to a hidden input value dynamically, if at all possible. There's always the option of including hard coded status codes in hidden inputs, but that means there needs to be an installation code to match each potential error-page/status-code, and that makes the installation more complicated. The same goes for using php/ruby etc to grab the status code - the installation would become more complex. Ideally there would be one universal piece of code. Any suggestions?