onSubmit = (e) => {
e.preventDefault()
const errors = this.validateForm()
if (!errors) {
const { handleSubmit } = this.props
handleSubmit(e)
}
}
<---------- unit test --------->
it('calls onSubmit prop function when form is submitted', () => {
con
我有一个这样的列表: const form = [
<Input title="What is your age?" onSubmit={} />, // this onSubmit sets age
<MultipleChoice title="What is the weather today?" onSubmit={} />, // this onSubmit sets weather
<Input title="What is the brand of your rain coat?"
当调用uploader时,我遇到了一些问题,试图将onSubmit保留为onSubmit上下文。任何JS大师能帮上忙吗?
uploader: {
init: function(){
var that = this;
var fileUploader = new Uploader.FileUploaderBasic({
button : $("#upload-btn")[0],
action : "/fil
我不明白为什么这个按钮不能在手机上工作。我试过几种不同的方法,但似乎做不到。所有的东西在桌面上都很好,但在移动设备上就不行了(谷歌检查或实际的iPhone)。使用Wordpress。
// Starts the sequence from the GO button
function onSubmit() {
inputHandler();
findItem(input)
}
<button class="barItem" style="width: 40px" id="submit" onclick={onSubmit()}&
我无法获取表单以在提交时触发聚合物功能:
<form onsubmit="return _submit()"> //_submit is not defined
<form onsubmit="return this._submit()"> //this._submit is not a function
<form onsubmit="_submit"> //_submit is not defined
<form onsubmit="{{_submit}}"> //no outp