add #1: There is a bug in domplate it generates <br></br> for the BR()
tag.
If you remove BRs from your template it'll work
If you file a bug I'll fix it.
add #2: Use shared click handler for your radio buttons
var template = domplate(
{
tag:
DIV({class:'rulesets', onclick:"$onClick"},
INPUT({ type:'radio'}, "Level A, AA and AAA (highest level
of accessibility)"),
INPUT({ type:'radio'}, "Level A and AA"),
INPUT({ type:'radio'}, "Level A (lowest level of
accessibility)"),
INPUT({ type:'radio'}, "Level A"),
),
onClick: function(event)
{
// event.target is clicked radio button
console.log("onclick " + event.target);
}
});
Honza
On Mar 30, 10:09 pm, Prasanna Bale <[email protected]> wrote:
> Hi,
>
> I have written a template for preferences to set for my tool. It does have
> a FORM, RADIO buttons, CHECKBOX and the BUTTON.
>
> 1. The button has to save the changes made to the form and update the form.
> but some how onclick event is not fired when I click on the button. I did
> pasted my template on domplate Runner to debug, but I see the same behavior.
> 2. Also Can I trigger any onclick/onchange event when the radio button is
> selected ?
>
> Please find my template below.
>
> var ruleset_data = {
> ruleset_description: "rule description",
> ruleset_author: "rule author"}
>
> var template = domplate(
> {
> tag:
> DIV({class:'rulesets'},
> DIV({class: 'ai-ruleset'}, "Select Ruleset"),
> TABLE({class: 'ai-ruleset-table', cellspacing: 0, cellpadding: 0,
> border:1},
> TBODY(
> TR(TD({onclick:"highlight", id: "IITAA20", _index: '0'},
> "IITAA2.0
> (0.5 beta)")),
> TR(TD({onclick:"highlight", id: "WCAG20T", _index: '1'}, "WCAG2.0
> ARIA Transitional (0.5 beta)")),
> TR(TD({onclick:"highlight", id: "WCAG20S", _index: '2'}, "WCAG2.0
> ARIA Strict (0.5 beta)"))
> )//end TBODY
> ),
> BR(),
> DIV('Description'),
> TEXTAREA({class: 'textar'},
> "$ruleset_data.ruleset_description"
> ),
> BR(),
> DIV('Author'),
> TEXTAREA({class: 'textara'}, "$ruleset_data.ruleset_author"),
> BR(),
> H3('Select 2.0 Success Criteria Level'),
>
> FORM({},
> *INPUT*({ type: '*radio*'}, "Level A, AA and AAA (highest level
> of accessibility)"),
> BR(),
> *INPUT*({ type: '*radio*'}, "Level A and AA"),
> BR(),
> *INPUT*({ type: '*radio*'}, "Level A (lowest level of
> accessibility)")
> ),
> BR(),
> H3('Other Options'),
> FORM({},
> INPUT({class: 'formElements', type: 'checkbox'}, "Enable
> checking for broken links"),
> BR(),
> INPUT({class: 'formElements', type: 'checkbox'}, "Show
> 'Accessibility' menu in main menu")
> ),
> BR(),
> *BUTTON*({class: 'button', checked: "true", type: "checkbox", *
> onclick*: "$onRulesetChange"},
> "Save Changes"
> ),
> *BUTTON*({class: 'button', checked: "true", type: "checkbox", *
> onclick*: "$onRulesetChange"},
> "Restore Default Preferences"
> )
> ),
>
> onRulesetChange : function(event){
> alert("alert");
> }
>
> });
>
> And I am using Firebug1.10.a5
>
> Thanks,
> Prasanna
--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug