本文档由 Apifox 自动生成,推荐使用 Apifox - API 文档、API 调试、API Mock、API 自动化测试!
<form> by clicking a "submit" button. This is a generally anticipated behavior that should be addressed as frequently as feasible.form element. Instead, the developer must include a JavaScript onSubmit callback that will send the required HTTP requests. The following is a complete example for adding a form to collect a comment on a product:<form> element contains the onsubmit attribute, which is an event. This event is triggered when the form is submitted. Sequentially, the method salla.comment.add will be implemented, which is one of the Twilight API JS SDK methods. onSubmit calls the helper method salla.comment.add, which in its turn converts all of the form inputs to an object and passes it as arguments to that method. Below is that code that will be run as a result of submitting the previous form:<salla-button>#<salla-button> which allows calling functions built by Salla to carry out certain activities.<salla-button> is used to submit the form, which causes the helper method salla.comment.add to be called and implemented. It will be loaded automatically and wait for any response from the server.<salla-button> component will receive the server Response, which looks like the following schema:message to the response and a success flag indicating whether or not the message was successful.扫码加入 Apifox 微信交流群
在这里,获得 Apifox 使用上的任何帮助,快速上手让你的研测效率得到大幅提升

扫码加入交流群