Clear multiple checkbox
i have a field with radio button (3 selection)
i have 3 more checkbox fields (multiple selection) associated with this radio buttons. i would like to clear and hide 2 checkbox field one 3rd one is selected..viceversa
i did the hidden part but not able to clear the checkboxes.
help
function CorporateFields() {
var p = fd.field('DocNeed').control().value();
if (p == 0) {
$('.corpEnt').show(); // Enable
$('.site').hide(); // Disable
$('.dept').hide(); // Disable
}
else if (p == 1) {
$('.corpEnt').hide(); // Disable
$('.site').hide(); // Disable
$('.dept').show(); // enable
}
else if (p == 2) {
$('.corpEnt').hide(); // Disable
$('.site').show(); // enable
$('.dept').hide(); // Disable
}
else {
}
}
fd.field('DocNeed').control().change(function () {
CorporateFields();
});
// Initialize
CorporateFields();
i have 3 more checkbox fields (multiple selection) associated with this radio buttons. i would like to clear and hide 2 checkbox field one 3rd one is selected..viceversa
i did the hidden part but not able to clear the checkboxes.
help
function CorporateFields() {
var p = fd.field('DocNeed').control().value();
if (p == 0) {
$('.corpEnt').show(); // Enable
$('.site').hide(); // Disable
$('.dept').hide(); // Disable
}
else if (p == 1) {
$('.corpEnt').hide(); // Disable
$('.site').hide(); // Disable
$('.dept').show(); // enable
}
else if (p == 2) {
$('.corpEnt').hide(); // Disable
$('.site').show(); // enable
$('.dept').hide(); // Disable
}
else {
}
}
fd.field('DocNeed').control().change(function () {
CorporateFields();
});
// Initialize
CorporateFields();
To check a particular option in a checkbox control:
To uncheck all options in a checkbox control:
To check all options:
See the following link for information about how to set values on any type of field:
http://spform.com/forms-designer- ... eld-values
Code: Select all
//checkBoxIndex starts with 0
var checkboxIndex = 2;
fd.field('MultiChoice').control()._el()
.find('input[type="checkbox"]').eq(checkboxIndex)
.prop('checked', true);
Code: Select all
fd.field('choice').control()._el()
.find('input[type="checkbox"]')
.prop('checked', false);
Code: Select all
fd.field('choice').control()._el()
.find('input[type="checkbox"]')
.prop('checked', true);
http://spform.com/forms-designer- ... eld-values
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Use this code:
Code: Select all
if (fd.field('Choice').value().length == 0) {
alert('Please, fill-in the choice field.');
return false;
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests