Using Prototype
Code:
AjaxPreview = Class.create();

AjaxPreview.prototype =
{
    initialize: function(id, div, iframe)
    {
        this.form = id;
        this.div = div;
        this.iframe = iframe;

        $(id).addClassName('viewForm');
        Event.observe(id, 'submit', this.router);
    },

    router: function()
    {
        alert(this.form);
    }
}
and setting up like this:

HTML Code:
            <input type="submit" id="submit" name="submit" value="Generate Preview" />
        </form>
        <!-- SET UP AJAX PREVIEW -->
        <script type="text/javascript">
            var preview = new AjaxPreview('preview', 'upload', 'frame');
        </script>
    </body>
</html>
When I submit the form the alert that comes up shows undefined, but it should show the ID of the form that was set with the new AjaxPreview().

I honestly don't have a clue why it's not working. Any help would be great.

PS. the router method is just testing that the variables are set at the moment. It'll be used for something different later on haha.