Skip to content

Instantly share code, notes, and snippets.

@phillmv
Created March 28, 2012 03:05
Show Gist options
  • Save phillmv/2223210 to your computer and use it in GitHub Desktop.
Save phillmv/2223210 to your computer and use it in GitHub Desktop.
var FormObject = function(form_id)
{
this.attr_base = "";
var self = {
form_id: form_id,
attr_name: this.attr_base + "[name]",
attr_form_name: this.attr_base + "[form_identifier]",
to_html: function() {
return "<td>" +
"<input name='" + this.attr_name + "' type='text'>" +
"<input name='" + this.attr_form_name + "' type='hidden' value='" + this.form_id + "'>'" +
"</td>";
}
};
return self;
};
/*
I want to create a OptionCategory object that "inherits" the above and overrides this.attr_base
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment