Page 1 of 1
Select Option Value
Posted: 23 Jul 2014
by schuess
How can I execute an action against each option that has been selected in a multi-selection SharePoint control.
fd.field('vidConfRooms').change(function() {
if (fd.field('vidConfRooms').control()._el().value() == '1'){
$('.fd_field[fd_name="atlantaCRRep"]').show();
} else{
$('.fd_field[fd_name="atlantaCRRep"]').hide();
};
});
Re: Select Option Value
Posted: 24 Jul 2014
by Dmitry Kozlov
Hi Matt,
Do you mean multi-lookup or choce with checkboxes field?
Re: Select Option Value
Posted: 24 Jul 2014
by schuess
Multi-lookup
Re: Select Option Value
Posted: 25 Jul 2014
by Dmitry Kozlov
Hi Matt,
Please, try the sample below:
Code: Select all
fd.field('vidConfRooms').change(function() {
var selectedOptions = fd.field('vidConfRooms')
.control()._el().find('select:eq(1) option');
for (var i = 0; i < selectedOptions.length; i++) {
if (selectedOptions.eq(i).text() == 'Room 1') {
alert('Room 1 is selected');
}
}
});
Re: Select Option Value
Posted: 25 Jul 2014
by schuess
an alert in this function doesn't even work.
//Goal for Code Below: When a Conference Room is Selected from the Multi-Selection Lookup List Control, .show() it's corresponding field.
//(For testing purposes, just try and alert the value selected.)
//NOT WORKING
fd.field('vidConfRooms').change(function() {
var selectedOptions = fd.field('vidConfRooms').control()._el().find('select:eq(1) option');
alert("change happened");//this never fires
for (var i = 0; i < selectedOptions.length; i++) {
if (selectedOptions.eq(i).text() == "Atlanta Office - Conference Room") {
alert('atlantaCRRep is selected');
}
}
});
Re: Select Option Value
Posted: 25 Jul 2014
by schuess
an alert in this function doesn't even work.
//Goal for Code Below: When a Conference Room is Selected from the Multi-Selection Lookup List Control, .show() it's corresponding field.
//(For testing purposes, just try and alert the value selected.)
//NOT WORKING
fd.field('vidConfRooms').change(function() {
var selectedOptions = fd.field('vidConfRooms').control()._el().find('select:eq(1) option');
alert("change happened");//this never fires
for (var i = 0; i < selectedOptions.length; i++) {
if (selectedOptions.eq(i).text() == "Atlanta Office - Conference Room") {
alert('atlantaCRRep is selected');
}
}
});
Re: Select Option Value
Posted: 28 Jul 2014
by Dmitry Kozlov
Make sure that 'vidConfRooms' is the correct internal name of the field. If so, please, send HTML-source of the form page to
support@spform.com
Re: Select Option Value
Posted: 29 Jul 2014
by Dmitry Kozlov
Hello Matt,
Thanks for the provided sources. The internal name of the field is 'vidConfRooms0', please, correct it in your code and it will start working:
Code: Select all
fd.field('vidConfRooms0').change(function() {
var selectedOptions = fd.field('vidConfRooms0').control()._el()
.find('select:eq(1) option');
alert("change happened");
for (var i = 0; i < selectedOptions.length; i++) {
if (selectedOptions.eq(i).text() == "Atlanta Office - Conference Room") {
alert('atlantaCRRep is selected');
}
}
});
Get information on how to get internal names of fields:
http://social.msdn.microsoft.com/Forums ... mentlegacy