List (multiple-selection) display length

  • 11 August 2017
  • 5 replies
  • 2 views

Badge +2

Hello,

I am trying to display a list of options around 170 entries long.

To do this, List (multiple-selection) seems to be the best option for me.

However, it seems like the control refuses to display more then 4 lines.

I have searched for this question and it was asked once before, and a very short answer was given that just said this:

$('#*id*').attr('size',7)

Now I understand that I need to change the size attribute to a number that fits on my form, however I am unsure how to find my ID.

I did inspect the element and uncovered an ID=1249afba-3713-4218-b7e7-e9fbfdbbbdb0, and the control itself is named in the editor as choOGshipping.

Also, when I am adding this small script, what is the syntax required to use it?

Currently I have this in the custom javascript section of the form settings.

<script>

$('#choOGshipping').attr('size',20)

</script>

This does not work though.

Sharepoint 2010

Nintex Forms 2010

Thanks in advance for any help!


5 replies

Userlevel 5
Badge +14

your script should look like this

NWF.FormFiller.Events.RegisterAfterReady(function () {
    NWF$('#' + jsvarShipping).parent().find('select').attr('size',7)
})‍‍‍‍‍‍

 jsvarShipping is javascript variable configured for the control in its advanced settings

206517_pastedImage_1.png

the code should be placed as is into form's settings 'Custom javascript'  inputbox.

you need not care about ay any HTML tags, it's automatically handled in the background

Badge +2

Hello! Marian!

Thanks for your quick reply!

I've tried to set it up the way you have suggested and I am still not seeing any change:

Object Advanced Properties

206509_pastedImage_2.png

Form Settings

206519_pastedImage_3.png

Result in Preview

206520_pastedImage_4.png

Result in Editor

206521_pastedImage_5.png

Can you see anything wrong with what I have done?

Also thanks again for your help, even the help with how to script correctly goes a long way happy.png,

Greg

Userlevel 5
Badge +14

the above posted code is meant for lookup control with allowed multiselect (I just followed and corrected the script you posted).

but from pictures you posted right now it looks like you do not use lookups.

is it a choice?

could post a screenshot of its whole config dialog?

Badge +2

My apologies, yes it is a choice.

It was originally in a repeating section but no longer is.

Would you recommend a lookup field instead?

It is also not connected to a field in the list, as again it was originally in a repeating section.

206522_pastedImage_1.png

Please let me know if I can provide you with any further information.

Userlevel 5
Badge +14

I updated above script to work for choices

Reply