Hello,
I have a drop down field, which uses dynamic values.
Is it possible to adjust the high of the drop down field depending on the amount of values?
Kind regards
Astrid
I have a drop down field, which uses dynamic values.
Is it possible to adjust the high of the drop down field depending on the amount of values?
Kind regards
Astrid
Hi Astrid,
You need to change the size attribute I think - you might be able to do that with JavaScript.
Bob
You need to change the size attribute I think - you might be able to do that with JavaScript.
Bob
Hi Bob,
thank you for your quick reply.
I know it, I have to learn more JavaScript :-)
But perhpaps anyone can give me an lInk to an example where I can start ...
Regards
Astrid
thank you for your quick reply.
I know it, I have to learn more JavaScript :-)
But perhpaps anyone can give me an lInk to an example where I can start ...
Regards
Astrid
Hi Astrid,
This seems to work
The two drop-downs have ids dropdown1 and dropdown2. There is a little extra code to delay the change until ChronoForms has assigned the new options. You can see this working here
Bob
This seems to work
jQuery(document).ready(function(jQ){
jQ('#dropdown1').on('change', delayUpdate);
function delayUpdate() {
setTimeout(changeSize, 50);
}
function changeSize() {
var size = jQ('#dropdown2').children('option').length;
jQ('#dropdown2').prop('size', size);
}
});
The two drop-downs have ids dropdown1 and dropdown2. There is a little extra code to delay the change until ChronoForms has assigned the new options. You can see this working here
Bob
This topic is locked and no more replies can be posted.