<form onSubmit={handleSubmit} className="AddAssignmentForm">
<div className="form-body">
<div>
<Field name="assignment" component={renderField} type="text" label="Assignment" />
</div>
<div>
<div>
<Field name="github" component={renderField} type="text" label="Github" />
</div>
</div>
<div>
<div>
<Field name="teacher" component={renderField} type="text" label="Teacher" />
</div>
</div>
<div className="button-class">
<button
type="submit"
name="action"
disabled={pristine || submitting || invalid}
className="waves-effect waves-light btn"
>
Submit
</button>
<button
type="button"
disabled={pristine || submitting}
onClick={reset}
className="waves-effect waves-light btn"
>
Clear Values
</button>
</div>
</div>
</form>
我有这个redux表单。我想在用户填写表单并将其存储在某处时输入日期时间。有谁知道该怎么办?
答案 0 :(得分:0)
用户提交表单时执行的函数是redux表单分发函数上的onSubmit
。因此,我将在此处生成时间戳,并使用它进行所需的操作。