how do i remove the none option from a cascading select

edit- cascadingselect.vm file looks like this

##disable_html_escaping() TODO REENABLE

#if (!$request || !$request.getAttribute("cascade"))

$!request.setAttribute("cascade" , "true")

#end

#if ($value.getValuesForKey(null) && !$value.getValuesForKey(null).empty)

#set ($selectedParent = $value.getValuesForKey(null).iterator().next())

#end

#if ($value.getValuesForKey('1') && !$value.getValuesForKey('1').empty)

#set ($selectedChild = $value.getValuesForKey('1').iterator().next())

#end

$!{auiparams.put("controlHeaderClass", "aui-field-cascadingselect")}

#customControlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters $auiparams)

<select class="select cascadingselect-parent" id="${customField.id}" name="${customField.id}">

<option class="default-option" value="">$i18n.getText("common.words.pleaseselect")</option>

<option class="default-option" value="-1">$i18n.getText("common.words.none")</option>

#foreach ($option in $configs.options.rootOptions)

#if(!$option.disabled || $option.disabled == false || ($selectedParent && $selectedParent == $option.optionId.toString()))

<option class="option-group-$option.optionId" value="$option.optionId"#if ($selectedParent && $selectedParent == $option.optionId.toString()) selected="selected"#end>$cfValueEncoder.encodeForHtml($option.value)</option>

#end

#end

</select>

<select class="select cascadingselect-child" id="${customField.id}:1" name="${customField.id}:1">

<option class="default-option" value="">$i18n.getText("common.words.pleaseselect")</option>

<option class="default-option" value="-1">$i18n.getText("common.words.none")</option>

#foreach ($parentOption in $configs.options.rootOptions)

<option class="option-group-$parentOption.optionId" value="">$i18n.getText("common.words.pleaseselect")</option>

<option class="option-group-$parentOption.optionId" value="-1">$i18n.getText("common.words.none")</option>

#foreach ($childOption in $parentOption.childOptions)

#if(!$childOption.disabled || $childOption.disabled == false || ($selectedChild && $selectedChild == $childOption.optionId.toString()))

<option class="option-group-$parentOption.optionId" value="$childOption.optionId"#if ($selectedChild && $selectedChild == $childOption.optionId.toString()) selected="selected"#end>$cfValueEncoder.encodeForHtml($childOption.value)</option>

#end

#end

#end

</select>

#customControlFooter ($action $customField.id $fieldLayoutItem.fieldDescription $displayParameters $auiparams)

$!{auiparams.clear()}

_________________________________

what lines should I delete to remove the option None

1 answer

1 accepted

0 vote

Take this out and see what happens.

&lt;option class="default-option" value="-1"&gt;$i18n.getText("common.words.none")&lt;/option&gt;

thanks thata worked and then I removed <option class="option-group-$parentOption.optionId" value="-1">$i18n.getText("common.words.none")</option> for the 2nd select option

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Thursday in Off-topic

Friday Fun: Magic Eyes

...staring into the background. Once the image pops out in 3D, you can look around the picture and enjoy. If you will see if you are a true illusion master! :) You did it? :) Wow! Awesome! As a bonus...

420 views 79 11
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you