and setting up like this:
AjaxPreview = Class.create();
initialize: function(id, div, iframe)
this.form = id;
this.div = div;
this.iframe = iframe;
Event.observe(id, 'submit', this.router);
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().
<input type="submit" id="submit" name="submit" value="Generate Preview" />
<!-- SET UP AJAX PREVIEW -->
var preview = new AjaxPreview('preview', 'upload', 'frame');
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.
Ah never mind I've figured it out via this link.