从相同的形式有两种动作 [英] Two actions from the same form

查看:140
本文介绍了从相同的形式有两种动作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有一个表单执行两个脚本,这样就意味着从同一个形成两个不同的操作。我试着使用form.submit()从一个onClick行动提交按钮的一些JavaScript代码。但两个动作中的一个是一个ASPX脚本进到动态CRM。有什么建议?

I need to have a form execute two scripts so that means two different actions from the same form. I've tried some javascripts that use form.submit() from an onClick action on a submit button. But one of the two actions is an ASPX script that goes to Dynamics CRM. Any suggestions?

推荐答案

使用 jQuery的,则可能会中断表单提交和做自己的事才真正提交。

Using jQuery, you could interrupt the form submission and do your own thing before it actually submit.

例使用 jQuery的AJAX帖子

$( 'form' ).submit( function(){
    $.post( 
        'action2.php', // url of php

        {                // data to send
            data1:'bob', 
            data2:'denver'
        }

    )
})

这篇关于从相同的形式有两种动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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