Skip to main content
Known Participant
November 9, 2021
Question

Simulation of Password field with conditions

  • November 9, 2021
  • 1 reply
  • 245 views

Hello, I'm creating exercise for users to learn step by step process in with some online platforms. One step is creation of clog-in credentials. I would like to have entry box for user password which will simulate Password field for loging-in. User must enter her/his password with folowing Conditions as input/entry minimaly 8 characters long

AND

minimaly one capital letter

AND

minimaly one special character

AND

minimaly one number.

When thay create their password "Next" button is Enabled. Is there any way to make such option with text boxes, advanced actions, variables...? Thanks.

 

    This topic has been closed for replies.

    1 reply

    Stagprime2687219
    Legend
    November 9, 2021

    You can find my response to a similar question about validating password requirements at the thread below. It is a bit complex and would require some JavaScript.

     

    https://community.adobe.com/t5/captivate-discussions/random-question-about-possibility-to-create-a-simulation/m-p/12408169#M293727

     

    Hopefully it helps.

    Inspiring
    November 23, 2021

    I'm working on a password checker that you can embed in Captivate as iFrame content.

    It is a bit tricky 😉

    I should end up having both a version where you can embed the code in your file and use TEB's inside Captivate and also complete embedable app with HTML, CSS and assets.

    Here you have some cut outs from my source. 

        <script>
            var PPerson = '';
            var PAction = '';
            var PObject = '';
            var Sentence = '';
            var OriginalPassword = '';
            var ModifiedPassword = '';
            var LastCompletedPage = 0;

            function getVarsFromCaptivate() {
                // try {
                try {
                    LastCompletedPage = window.parent.window.cpAPIInterface.getVariableValue("CaptivateLastCompletedPage");
                    PPerson = window.parent.window.cpAPIInterface.getVariableValue("CaptivatePPerson");
                    PAction = window.parent.window.cpAPIInterface.getVariableValue("CaptivatePAction");
                    PObject = window.parent.window.cpAPIInterface.getVariableValue("CaptivatePObject");
                    Sentence = window.parent.window.cpAPIInterface.getVariableValue("CaptivateSentence");
                    OriginalPassword = window.parent.window.cpAPIInterface.getVariableValue("CaptivateOriginalPassword");
                    ModifiedPassword = window.parent.window.cpAPIInterface.getVariableValue("CaptivateModifiedPassword");


                    function setVarsToCaptivate() {
                try {
                    window.parent.window.cpAPIInterface.setVariableValue("CaptivateLastCompletedPage", LastCompletedPage);
                    window.parent.window.cpAPIInterface.setVariableValue("CaptivatePPerson", PPerson);
                    window.parent.window.cpAPIInterface.setVariableValue("CaptivatePAction", PAction);
                    window.parent.window.cpAPIInterface.setVariableValue("CaptivatePObject", PObject);
                    window.parent.window.cpAPIInterface.setVariableValue("CaptivateSentence", Sentence);
                    window.parent.window.cpAPIInterface.setVariableValue("CaptivateOriginalPassword", OriginalPassword);
                    window.parent.window.cpAPIInterface.setVariableValue("CaptivateModifiedPassword", ModifiedPassword);
                }


                PPerson = $('#fieldPerson').val();
                                PAction = $('#fieldAction').val();
                                PObject = $('#fieldObject').val();
                                Sentence = PPerson + ' ' + PAction + ' ' + PObject;
                                OriginalPassword = PPerson + PAction + PObject;
                                ModifiedPassword = OriginalPassword;

                                setVarsToCaptivate();
                        $('#fieldPerson').val('');
                        $('#fieldAction').val('');
                        $('#fieldObject').val('');
                        $('#pwd').val('');
                       
                        if (pvalue == OriginalPassword || pvalue.length == 0) {

                            if (pvalue.match(/(?!Æ|æ|Ø|ø|Å|å)[\W|_]/)) {