2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
I havewxml
Code:
<view class="formclass">
<form bindreset="formReset" bindsubmit="getformdata">
<view class="ctl">
<view class="cfg-area">
<view>配置名</view>
<input class="inputctl" placeholder="配置1" value="重置测试"/>
</view>
<view class="button-area">
<button class="formclassbutton1" form-type="submit" >提交</button>
<button class="formclassbutton2" form-type="reset">重置</button>
</view>
</view>
</form>
</view>
I havejs
Form processing function:
getformdata: function(e){
console.log(e.detail.value);
}
The dictionary printed after submission is empty and it was stuck for more than ten minutes.
After I got better, I forgot that form controls must be addedname
The data can be submitted only if the attribute is set, otherwise it is invalid. The following is the corrected key code:
<input class="inputctl" name="configName" placeholder="配置1" value="重置测试"/>