We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Turn off autocompletion by default

2

Comments

  • billingibillingi Posts: 28
    I've just managed to disable the autocomplete functionality for a CRF using the following JavaScript.  This was added into the first entry in the 'Left Item Text' column (i.e. Cell C2) of the CRF Spreadsheet:

    <script src="includes/jmesa/jquery.min.js"></script>
    <script type="text/javascript">
        jQuery(document).ready(function($) {
    $('form').attr('autocomplete','off'); });
    </script>
    Normal Left Item Text


    Note that I'm using OC version 3.2.  Whilst searching the OC Forums / Googling, I noticed a comment that for OC versions before 3.1.4, you should use jquery-1-3-2.min.js instead of jquery.min.js.  However, I have not tested this myself.

    I added the above JavaScript to Version (n+1) of an existing CRF, as the only change from Version (n).  When entering data for Version (n), then the browser displays the autocomplete drop-down list (i.e. Default OC behaviour).  However, when entering data for Version (n+1), then the drop-down list no longer appears (i.e. Behaviour modified by JavaScript)

    Hope this information is useful.  Any comments / Suggestions on the above code will be gratefully received...
  • mikewormikewor Posts: 35
    @Christian.   Sorry, I expected everyone to read between the lines ;)   
    To be more explicit, if OC does offer the ability to manage auto-complete, it should only allow one to set autocomplete off within OC only, or back to the browser setting.   It should not allow autocomplete to be set on.
    For those who use autocomplete to simplify capture of e.g. concomitant medication, maybe we could ask OC to include a 'predictive text' input type.   This could be readily used instead of a drop down list when one has a large number options and could be a huge win for getting clean data.
  • haenselhaensel Posts: 602 ✭✭✭
    Hi Mike

    Thanks for clarification. I'm not shure if it's possible to enable autocompletion from within the webpage if this feature is turned of by the browser. It's an interessing question I never checked the answer for. But I would be surprised if it's possible

    Regards,
    Christian

    mikewor said:
    @Christian.   Sorry, I expected everyone to read between the lines ;)   
    To be more explicit, if OC does offer the ability to manage auto-complete, it should only allow one to set autocomplete off within OC only, or back to the browser setting.   It should not allow autocomplete to be set on.
  • kristiakkristiak Posts: 1,339 ✭✭✭
    Using WIN 8.1 update 1 with OC 3.2 and IE 11 with auto completion enabled I tried several different type of fields and in none could I get auto completion to work within OC 3.2. Which version of OC did you use Ian?  I had set all the options in IE11 to autocomplete but within OpenClinica it did not work in any type of field. (As it should be according to our validation scripts). I do remember some time ago, forgot which version, that IE? remembered username and password but this had gone away with the version that eventually released.
  • billingibillingi Posts: 28
    Kristiak,

    I have 2 different OC instances on different operating systems - Windows 7 (Devt) & Linux (Test).  Both instances are running the same version of OC (3.2) and the same CRF Definitions. I have 2 CRFs - One which contains the above javascript to disable auto-completion and one which doesn't

    When using the latest version of Firefox (currently 29.0.1), then the auto-complete works as expected (i.e. It is disabled on one form, but not on the other).  However, when using IE10 with the autocomplete functionality turned on, then it seems to be disabled on both forms.  Having consulted Google, this seems to be a 'feature' of IE10.

    What results do you get when using Firefox?

    Ian
  • kristiakkristiak Posts: 1,339 ✭✭✭

    Ian,

    I tested FireFox on my test system with WIN 8.1 update 1 and OC 3.2. I tested various filed like date fields and text fields but in no case auto-complete work in spite of the fact that it was activated in FireFox (all the options).

    In conclusion...I cannot confirm that auto-completion works in OC 3.2 regardless of browser.

    Regards


    Krister

  • haenselhaensel Posts: 602 ✭✭✭
    edited May 2014
    Hi guys

    w3schools has an autocompletion test form [1] that might help to test the different setups independently from OC.

    Regards,
    Christian

    [1] autocompletion test form
    Post edited by haensel on
  • kristiakkristiak Posts: 1,339 ✭✭✭

    Interesting, I'm sure that in many forms the auto-completion is set to "on" with code like this. I have seen many WEB sites where auto-completion is activated even when my browser has it disabled.

    Since I could not make it work I wonder if auto-completion is disabled in OC by default, but that would not explain Ian's findings. Maybe someone familiar with the OC source code could help explaining this mystery.

    Regards


    Krister

  • haenselhaensel Posts: 602 ✭✭✭
    Hi Krister

    Do you have an example so I can verify this?

    Regards,
    Christian

    kristiak said:

    I have seen many WEB sites where auto-completion is activated even when my browser has it disabled

  • kristiakkristiak Posts: 1,339 ✭✭✭
    via Email
    Hi Christian,

    Not right off hand by I will look for such a page!'

    Regards

    Krister
This discussion has been closed.