简体   繁体   English

使用JavaScript提交表单

[英]Form submission using javascript

i have used following javascript to submit a form, In that script, if i remove the alert() mean, the form doesnot submit. 我已使用以下javascript提交表单,在该脚本中,如果删除了alert(),则表单不会提交。 with the alerts box only form submits. 与警报框仅表单提交。 how can i resolve the problem 我该如何解决问题

<script type="text/javascript" >
    function caless(id)
    {

    document.formname.page.value=id;
    document.formname.submit();
    alert('');
    }
</script>

Most likely this code is called from within a link onclick? 最有可能从onclick链接中调用此代码? In such case, change to: 在这种情况下,请更改为:

function caless(id)
{
    document.formname.page.value=id;
    document.formname.submit();
    return false;
}

Then in the onclick: 然后在onclick中:

<a ... onclick="return caless(id);">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM