首页 > 解决方案 > React Semantic UI Form,提交表单后不向用户提供保存密码

问题描述

我正在使用 React Semantic UI,并且我有简单的注册表单。我希望浏览器在用户Do you want to save password for this website?提交表单后询问用户,因为现在当我发送表单时,它只会执行我的操作,并且在处理完请求之后就是这样。我试图标记自动完成等。没有任何帮助。我该如何解决?谢谢。sendLoginRequest

sendLoginRequest = () => {
  ...
}
 render() {
        return (
            <Fragment>
                <Form onSubmit={this.sendLoginRequest}>
                    <Form.Input
                        required
                        label="Name"
                        type="text"
                        placeholder="Name"
                        name="name"
                        onChange={this.handleChange}
                        {...this.state.errors.name}
                    />
                    <Form.Input
                        required
                        label="Email"
                        type="email"
                        placeholder="Email"
                        name="email"
                        onChange={this.handleChange}
                        {...this.state.errors.email}
                    />

                    <Form.Input
                        required
                        label="Password"
                        type="password"
                        placeholder="Password"
                        autoComplete="new-password"
                        name="password"
                        onChange={this.handleChange}
                        {...this.state.errors.password}
                    />
                    <Form.Input
                        autoComplete="new-password"
                        required
                        label="Repeat Password"
                        type="password"
                        placeholder="Again Password"
                        name="repeatPassword"
                        onChange={this.handleChange}
                        {...this.state.errors.repeatPassword}
                    />
                    <Button type='submit'>Submit</Button>
                </Form>
                <Spinner visible={this.state.spinner} />
            </Fragment>
        )
    }

标签: javascriptreactjssemantic-ui

解决方案


推荐阅读