Home>

【problem】
Currently, we are creating a password reissue function using the pop-up "confirm".
Then, after pressing "Yes" in the pop-up "confirm", I want to display another pop-up, but I don't know how to implement it.

* The implementation to be completed is as follows.

[Implementation procedure]
1. When the reset button is pressed, the pop-up created by "confirm" will be displayed.
The pop-up message is "Can I reset my password?"
2. Issue a new password with a random string using an existing regular expression
3. Encrypt the new password and save it in the DB
4. A pop-up message "The new password is _____." Is displayed.

The above implementation procedure describes all the steps, but in this question, [4. Pop-up "The new password is _____" is displayed. ] Can be solved.

[Question]
In implementation step 1, id was specified for the reset button, and when the reset button was pressed, the created pop-up appeared. However, since the pop-up in mounting step 4 does not specify the id, what key is used? I don't know if I want to display a pop-up. Should I specify the id somewhere?

[Development environment/Language used]
・ STS
・ Java
・ MySQLDB
・ Javascript
・ Jsp

  • Answer # 1

    If 2 and 3 are to be processed using ajax while staying on the same screen, you can display alert at 4 depending on the value returned by ajax (conditions such as when true is returned). I think.
    If you want to make a screen transition between 2 and 3, I think you should display it suddenly on the transition destination screen, but how about it?

  • Answer # 2

    I want to display another popup after pressing "Yes" in the popup "confirm", but I don't know how to implement it.

    Judged by the return value of window.confirm.

    result isBoolean value indicating whether OK (true) or Cancel (false) was selectedis. If the browser rejects the in-page dialog, result is always false.

    if (confirm ("Kettle")) {
        //Yes
        alert ("It was" yes ");
    }

    In implementation step 1, id was specified for the reset button, and when the reset button was pressed, the created pop-up appeared. However, since the pop-up in mounting step 4 does not specify the id, what key is used? I don't know if I want to display a pop-up. Should I specify the id somewhere?

    In the first place, it is not presented how to combine the "reset button" and "id", so the aboveconfirm confirmI can't even tell if is appropriate.
    There is more than one "pop-up".

    Regarding the "id", I think "I should keep it somewhere", but I can't say anything at the moment because it depends on the implementation.