Skip to content

Instantly share code, notes, and snippets.

@JohnB
Created December 10, 2009 16:46
Show Gist options
  • Save JohnB/253446 to your computer and use it in GitHub Desktop.
Save JohnB/253446 to your computer and use it in GitHub Desktop.
// Example markup for user edit dialog. Simple tags, with no specified class or id
// just contain an array holding their nested markup. More complex ones hold a hash
// with tag fields and a "ui" field holding their nested markup. This data would be
// recursed over to generate the expected HTML markup.
var markup = {
div: {id: 'user_dialog', ui: {
table: [
{tr: [
{td: {_class:'field_name', value:'Name'}},
{td: [
{input: {type:'text', id:'name', size:40}},
{span: {id: 'err_msg_for_name', _class:'err_msg'}}
]}
]},
{tr: [
{td: {_class:'field_name', value:'Password'}},
{td: [
{input: {type:'password', id:'password', size:40}},
{span: {id: 'err_msg_for_password', _class:'err_msg'}}
]}
]},
{tr: [
{td: {_class:'field_name', value:'Confirm Password'}},
{td: [
{input: {type:'password', id:'confirm_password', size:40}},
{span: {id: 'err_msg_for_confirm_password', _class:'err_msg'}}
]}
]}
]
}}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment