表格应仅在填写所有数据时提交 [英] Form should submit only when all data is filled

查看:55
本文介绍了表格应仅在填写所有数据时提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在创建从我们的校园取出材料的材料旁路。

在第一页中,输入人员姓名取出材料,issue_date,department,vehicle_no,driver_name,purpose,received_by和remarks 。

在第二页没有。给出的材料。

在第三页,它创建没有。第二页中提到的行。假设5.创建了五行。此页面中的字段为material_name,company_sr_no,department_sr_no,数量,重量,备注。有两个按钮。一个是'取消'',另一个是表单提交按钮''添加''。


这里在第三页,常常出现一个问题。如果错误地按下回车键而没有填写所有细节,则提交表格(即按下添加按钮)。我怎么能阻止这个?我想在没有填充所有五行的情况下应该没有输入键的效果。如果任何人试图点击添加,添加按钮不应该工作,除非所有五行材料都被填满。


谢谢和问候,

Vikas

I now creating material outpass for taking material out from our campus.
In the first page, persons name taking material out, issue_date, department, vehicle_no, driver_name, purpose, received_by and remarks is entered.
In the second page no. of materials to taken out is given.
In the third page, it creates no. of row as mentioned in the second page. suppose 5. Five row is created. Fields in this page are material_name, company_sr_no, department_sr_no, quantity, weight, remarks. Two buttons are there. One is ''Cancel'' and other is form submit button ''Add''.

Here in third page, one problem regular occurs. When enter key is pressed by mistake without filling all details, the form is submitted (i.e. ''Add'' button is pressed). How can I stop this? I want to there should be no effect of enter key without filling all the five row. If any one tries to click ''Add'', ''Add'' button should not work untill and unless all the five rows of material are filled.

Thanks and regards,
Vikas

推荐答案

嗨...


在表单中添加一个onsubmit-handler调用验证所有字段的javascript函数:

hi ...

add an onsubmit-handler to your form and call a javascript function that validates all the fields:

展开 | 选择 | Wrap | 行号



hi ...


在表单和cal中添加一个onsubmit-handler la javascript函数验证所有字段:

hi ...

add an onsubmit-handler to your form and call a javascript function that validates all the fields:

展开 | 选择 | Wrap | 行号


请发布您的表单示例,因为它会在没看到你到目前为止所做的事情的情况下做一种猜测...


亲切的问候
please post an example of your form since it would be a kind of guesswork without seeing what you have done so far ...

kind regards


这篇关于表格应仅在填写所有数据时提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆