special_landing_page_that_redirects_user_before_submitting_a_password
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
special_landing_page_that_redirects_user_before_submitting_a_password [2016/03/11 12:43] – lucy | special_landing_page_that_redirects_user_before_submitting_a_password [2016/03/11 12:54] – lucy | ||
---|---|---|---|
Line 1: | Line 1: | ||
In some cases of a web based simulation you might only want to check if a user would actually enter a password in a form field but you don't want to actually let him enter the full password. In such a case you could place a little ajax script that automatically redirects the user to some awareness content before pressing the submit button. In the example below the user would be able to enter his username, but the moment he entered 3 digits of his password he automatically gets redirected to a different page (in this case google which you would replace with your elearning content). | In some cases of a web based simulation you might only want to check if a user would actually enter a password in a form field but you don't want to actually let him enter the full password. In such a case you could place a little ajax script that automatically redirects the user to some awareness content before pressing the submit button. In the example below the user would be able to enter his username, but the moment he entered 3 digits of his password he automatically gets redirected to a different page (in this case google which you would replace with your elearning content). | ||
+ | |||
+ | First you need to download http:// | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Next you can create a login page as the following {{: | ||
- | - <div class=" | ||
- | - <span style=" | ||
- | - <form action="? | ||
- | - <input class=" | ||
- | - <input class=" | ||
- | - <input class=" | ||
- | - </ | ||
- | - </ | ||
- | - </ | ||
- | - | ||
- | - < | ||
- | - jQuery(function() | ||
- | - { | ||
- | - $('# | ||
- | - { | ||
- | - var t=$(this).val(); | ||
- | - if(t.length >= 3) | ||
- | - { | ||
- | - ajax_stat(); | ||
- | - } | ||
- | - }); | ||
- | - | ||
- | - $('# | ||
- | - { | ||
- | - var t=$(this).val(); | ||
- | - if(t.length >= 3) | ||
- | - { | ||
- | - ajax_stat(); | ||
- | - } | ||
- | - }); | ||
- | - | ||
- | - function ajax_stat() | ||
- | - { | ||
- | - var addr = "? | ||
- | - var params = { Login: $('# | ||
- | - // | ||
- | - | ||
- | - $.ajax( | ||
- | - { | ||
- | - type: ' | ||
- | - data: params, | ||
- | - cache: false, | ||
- | - dataType: | ||
- | - success: function(res) | ||
- | - { | ||
- | - console.log(" | ||
- | - window.location = " | ||
- | - }, | ||
- | - url: addr | ||
- | - }); | ||
- | - } | ||
- | - }); | ||
- | - </ | ||
special_landing_page_that_redirects_user_before_submitting_a_password.txt · Last modified: 2019/07/25 12:50 by 127.0.0.1