Skip to content
Discussion options

You must be logged in to vote

On the login page, I want to first verify on the client side whether the two password inputs match. If the passwords don't match when clicking login, I want to use the alert function to notify the user. However, when I click the submit button, the ActionForm also executes server-side functions, which I don't want.
Additionally, when the passwords do match, I want to receive the backend response to inform the user whether login was successful. If verification fails, I want to use alert to notify the user of incorrect password.Here is my code:

use serde::{Deserialize,Serialize};
#[derive(Serialize,Deserialize,Debug,Clone)]
pub struct User {
    username:String,
    password:String,
}
#[comp…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@callmeitachi
Comment options

Answer selected by callmeitachi
@callmeitachi
Comment options

@gbj
Comment options

gbj Aug 15, 2025
Maintainer

@gbj
Comment options

gbj Aug 15, 2025
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants