fm-group-select sample to add groups to uploads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($('.groupSelectInputs').length > 0 ){ | |
// declares the group string | |
var groupsString = ""; | |
// Loops through all of the select inputs | |
$.each($('.groupSelectInputs'), function(i){ | |
groupsString = groupsString == "" ? this.value : groupsString +','+ this.value; | |
}); | |
// Convert the groups string to a readable array | |
groupsString = groupsString.split(','); | |
// Inserts the groups into the hidden input which is referenced when uploading | |
$('#groupHolder').val(groupsString); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Hidden input field to hold the group list --> | |
<input type="input" class="fmInput required" id="groupHolder" name="groupHolder" title="Select Group*" value="" /> | |
<br /> | |
<!-- Select 1 --> | |
<fm:Form_Select name="category" class="fmSelect groupSelectInputs"> | |
<option>-- Select a category --</option> | |
<fm:GroupList | |
moderationStatus="{%var:moderationGroups}" | |
parentGroup="11223" | |
sort="{%gallery:groupSort}" | |
> | |
<fm:Loop> | |
<fm:Form_Option value="{$$group.id}" label="{$$group.name}" /> | |
</fm:Loop> | |
</fm:GroupList> | |
</fm:Form_Select> | |
<!-- Select 2 --> | |
<fm:Form_Select name="category" class="fmSelect groupSelectInputs"> | |
<option>-- Select a category --</option> | |
<fm:GroupList | |
moderationStatus="{%var:moderationGroups}" | |
parentGroup="11223" | |
sort="{%gallery:groupSort}" | |
> | |
<fm:Loop> | |
<fm:Form_Option value="{$$group.id}" label="{$$group.name}" /> | |
</fm:Loop> | |
</fm:GroupList> | |
</fm:Form_Select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment