In this article, we will learn how to enable the "Hide/Show" feature that is available within the "Security -> Settings" option, for the "Remember Login" field that is found on the login screen that was generated with the HTML template.
Currently, this feature is automatically enabled when the security module is generated without using a custom HTML template for the Login screen. However, so that we can enable it in our login screen that has an HTML template, we must add two JavaScript functions inside our template's index file.
Below, let's see the procedures performed in each topic:
Enabling the field inside the HTML template index file
If the field is not enabled in your template, we need to follow the step by step below:
1 - Within the Login application in your ScriptCase, more precisely in "User's HTML", we click on the Check button to verify the fields that are not included in the HTML template file located in the external libraries. The expected result should be as shown in the images below:
2 - By clicking on "SC_FIELD_INFO_remember_me", a modal window will open that will show us an example of where the field should be added within the HTML template:
3 - Go to the "Tools -> External Libraries" option, then "Edit" in the library that we are using for the login HTML template, and look for the ".html" file:
4 - We add the field inside the "form" tag in the HTML code, and save the file:

For this case, we must add, in addition to the field, a "span" tag to insert the field inside it, because the "Remember me" field involves both the text itself, as well as the checkbox we selected. Therefore, we will need to insert the field inside this HTML tag.
5 - We go back to the Login application, and click again on the Check button (according to the first step), and we get the "OK" check for the {remember_me} field:
Enabling "scHideUserField()" and "scShowUserField()" functions to enable "Hide/Show"
For this option to work in the Security Module settings, we will need to add these two functions within the HTML code of our template.
The script for both is available below so we can just copy, paste and save:
- <script type="text/javascript>">
- // Function to enable and disable the remember me field
- function scHideUserField(fieldName)
- {
- if(fieldName == 'remember_me')
- {
- $('#id_sc_field_remember_me_1').hide();
- $('#txtremember').hide();
- }
- }
- function scShowUserField(fieldName)
- {
- if(fieldName == 'remember_me')
- {
- $('#id_sc_field_remember_me_1').show();
- $('#txtremember').show();
- }
- }
- </script>