Auto-complete Too: Add "Display Limit Option" to boost performance of the form

  • Profile Image
    alicchen
    Asked on February 27, 2013 at 08:10 PM

    I saw an earlier post about this but wasn't quite clear about the answer:

    I'm looking to make an auto-complete textbox which has ~10000 entries. I know that's on the high-end of the suggested number of entries. I've already made the form and copied all ~10K entries. It appears to work but seems to slow down the performance of the form.

    I saw a post stating that hosting the source code on my own server would improve the performance. Would that be as simple and just downloading the source code for the form and loadiing it on my own site? Are there additional steps that need to be done to improve performance?

  • Profile Image
    EltonCris
    Answered on February 28, 2013 at 03:18 AM

    Hi,

    Yes, just get your form's full source code and upload it to your website. That might possibly help, but I would still suggest to break down the 10K options if hosting the files doesn't show any improvements.

    Get back to us if you have further questions. Thanks!

  • Profile Image
    alicchen
    Answered on February 28, 2013 at 04:40 AM

    It seems to still hang even while hosting on my site. It would be hard to break the 10K options. Are there other ways to improve this? Would it be possible to make it 'smoother' by making the autocomplete limit to the number of suggestions displayed (say ~20)? The problem seems to occur when I input 1-3 letters in the form and too many options come up.

    Update:

    Answerd my own question. Opened up "jotform.js" and looked in the  "handleAutoCompletes: function()". Looked for the "// If matches found" comment and changed:

    if (matches.length > 0) 

    to

    if (matches.length > 0 && matches.length < 50) 

    This limits the search to only display if <50 matches are found. As a result, trivial inputs like 'a' or 'an' don't end up hanging browser due to results overload. I'll keep playing with that number to find one that make the most sense. Unfortunately, this requires hosting it on my own server. Any way get this "option" in the Jotform web form editor?

  • Profile Image
    EltonCris
    Answered on February 28, 2013 at 06:26 AM

    @alicchen

    Thanks for giving us a tip about this. Unfortunately we do not have that option on the form builder currently, however I have forwarded this as a feature request to our development team so they can review it and might be considered as an addition to JotForm.

    Thanks a lot!

  • Profile Image
    alicchen
    Answered on February 28, 2013 at 05:25 PM

    Thanks! Hope it makes it to production. If that feature is added, I would also suggest expanding the max character limit of the options. It seems to cut off and truncate my options list at 65535 characters (perhaps a SQL limit?). As a result, I needed to add my list separately after getting the source code.

    Additionally, it would be nice to be able to enter multiple entries in the autocomplete text box separated by commas. It should be feasibly considering jQueryui has that feature:

    http://jqueryui.com/autocomplete/#multiple

    This could be useful for making a clean form without multiple text-box entries for certain cases or for entering "tags".

  • Profile Image
    EltonCris
    Answered on February 28, 2013 at 08:43 PM

    Hi,

    According to MySQL, a text column holds 65,535 bytes so it's indeed a character limit for databases. You should consider separating the list.

    Regarding on the jQuery autocomplete request, we are using prototype and scriptaculous currently. This creates conflicts with jQuery references so it needs to be reviewed before it could be added to JotForm. However, we are on the road to jQuery since we just released an e-signature feature that runs with jQuery.

    Thanks!

  • Profile Image
    dalepotter_upreach
    Answered on January 22, 2014 at 11:00 AM

    could I bump this thread - would love to be able to use the auto-complete for 8K fields.  Can jotform raise the maximum number of permitted options?

  • Profile Image
    Cesar
    Answered on January 22, 2014 at 11:29 AM

    @dalepotter_upreach

    Kindly create a new thread so that we may assist you better. As we are working on one issue/request per thread. Thank you.