pop up alert on check box
Morning guys,
I have set up my form so that an alert pops up when I check a Void/Cancel check box.....
fd.field('Void/cancel').change(function() {
alert ('my alert');
});
The problem is that it also issues the alert when I uncheck the box, what am I missing so that the alert only appears when I check the void/cancel box
Cheers
I have set up my form so that an alert pops up when I check a Void/Cancel check box.....
fd.field('Void/cancel').change(function() {
alert ('my alert');
});
The problem is that it also issues the alert when I uncheck the box, what am I missing so that the alert only appears when I check the void/cancel box
Cheers
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Check the field value in the handler:
Check the field value in the handler:
Code: Select all
fd.field('Void/cancel').change(function() {
if (fd.field('Void/cancel').value()) {
alert ('my alert');
}
});
Hi Dmitry,
Following on from this, I changed my form to a check box and for the alert to appear if the check box is ticked. I used....
function setExtendedreasons() {
if (fd.field('Extended').value() =='1') {
$('.Extendedreasons').show();
alert ('You have extended the due date for this task. Please insert your comments in the narrative section under the Task Progress tab.');
} else {
$('.Extendedreasons').hide();
}
}
fd.field('Extended').change(setExtendedreasons);
setExtendedreasons();
The issue I have is that when the form is closed and then reopened the alert pops up before the form opens, what do I need to change in order for the alert to appear just when the box is ticked and not when the form opens??
Many thanks
Following on from this, I changed my form to a check box and for the alert to appear if the check box is ticked. I used....
function setExtendedreasons() {
if (fd.field('Extended').value() =='1') {
$('.Extendedreasons').show();
alert ('You have extended the due date for this task. Please insert your comments in the narrative section under the Task Progress tab.');
} else {
$('.Extendedreasons').hide();
}
}
fd.field('Extended').change(setExtendedreasons);
setExtendedreasons();
The issue I have is that when the form is closed and then reopened the alert pops up before the form opens, what do I need to change in order for the alert to appear just when the box is ticked and not when the form opens??
Many thanks
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Remove call of the setExtendedreasons on loading the form (last line).
-
- Information
-
Who is online
Users browsing this forum: No registered users and 6 guests