0
我是React和reactstrap的新手,我想知道如何设置一个表单,使用Form标签提交到路径后提交。我在找到这个文档的文档中找不到示例。所以我在寻找这样的一个等价的:如何在React中使用reactstrap库设置发布表单?
<form action='/signup/insert' method = 'POST'>
<div class="form-group">
<input id ='signup' type='text' name='uid' placeholder='Username'><br>
<input id ='signup' type='password' name='pwd' placeholder='Password'><br>
<input id ='signup' type='text' name='email' placeholder='E-mail address'><br>
<button id = 'switch' type='submit'>Sign Up</button>
</div>
</form>
我想是这样的:
<Form>
<FormGroup>
<Label for="exampleEmail">Email</Label>
<Input
type="email"
name="email"
id="exampleEmail"
placeholder="[email protected]"
/>
</FormGroup>
<FormGroup>
<Label for="examplePassword">Password</Label>
<Input
type="password"
name="password"
id="examplePassword"
placeholder="password"
/>
</FormGroup>
<Button>Sign Up</Button>
</Form>
我一定要在按钮标记添加呢?这个怎么做?我的路线已经建立,所以我只需要从这里发布。
JEP,谢谢,我已经有它想通了。免费给你奖励! – Ansjovis86