提交HTML表单 [英] Submitting HTML Form

查看:78
本文介绍了提交HTML表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



下午好,



如何在验证成功完成后从html页面向aspx页面提交数据?



这是我的表格代码

Hi,
Good Afternoon,

How to submit data to an aspx page from an html page after validation is done successfully?

This is my form code

<form id="frmDoctorRegistration" action="DoctorRegistration.aspx" onscroll="true"  onsubmit="ValidateForm();"   method="post" style="z-index:0" >





这是我的按钮代码





This is my button code

<input type="Submit" id="btnSave" name="btnSave"  onclick="ValidateForm()" value="Save" tabindex="16" /> 





我的问题是显示验证消息,即使html表单提交到aspx页面,如果我使用type =Submit。



后来验证完成我改了输入类型=按钮数据没有提交给Aspx pa ge。



and my problem is as validation messages are shown even html form is submitting to aspx page if I use type="Submit".

and later validation is done I changed input type="Button" data is not submitting to Aspx page.

推荐答案

尝试如下...

Try like below...
<input type="Submit" id="btnSave" name="btnSave" onclick="return ValidateForm()" value="Save" tabindex="16" />



在函数 ValidateForm 中,请执行以下操作...


In function ValidateForm, do like below...

function ValidateForm()
{
    if(not validated)
    {
        return false;
    }

    return true;
}


这篇关于提交HTML表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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