PDA

View Full Version : checkbox listener firing on load- need to fire onClick?



wshpoon
16 Jun 2010, 7:01 AM
Hi,

I need to create an onClick event for a checkbox that only fires when the checkbox is clicked via mouse and during load.

Here is what I have, but it doesn't work. It fires on load.

var siteReportCheckbox = new Ext.form.Checkbox(
{
width: 75,
boxLabel: 'Site',
name: 'sitereport',
id: 'sitereport',
listeners: {
check: {
fn: function(){alert(1)}
}
}
}
);

16 Jun 2010, 6:19 PM
Please post code in code tags in the future.

16 Jun 2010, 6:23 PM
Hi,

I need to create an onClick event for a checkbox that only fires when the checkbox is clicked via mouse and during load.

Here is what I have, but it doesn't work. It fires on load.

var siteReportCheckbox = new Ext.form.Checkbox(
{
width: 75,
boxLabel: 'Site',
name: 'sitereport',
id: 'sitereport',
listeners: {
check: {
fn: function(){alert(1)}
}
}
}
);

Your statement (in red above) is conflicting. please clarify.