SimpleModal 联系表

发布于 2024-08-20 17:21:04 字数 186 浏览 2 评论 0原文

首先感谢它,我搜索了很多模态表单,而您的似乎更容易使用和修改

我唯一的问题是如何使用您下载的联系表单版本,从调用模态表单的页面发送动态变量情态形式本身 ?

当您通过 js 文件( contact.js )来显示模式时,直接获取链接,我如何用它发送 var ?

抱歉我的英语不好,提前感谢

朱利安

first thanks for it, i searched for a lot of modal forms and yours seems to be the easier to use and modify

My only question is how, using your downloaded Contact form version, send a dynamique var from the page calling the modal form and the modal form in itself ?

As you go through a js file ( contact.js ) to show the modal, that directly take the link how can i send a var with it ?

Sorry for my bad english and thanks in advance

Julien

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

巨坚强 2024-08-27 17:21:04

您可以尝试这样的操作:

$(document).ready(function(){
        $("form#contact").submit(function(){

        var str = $("form#contact").serialize();

                           $.ajax({
                           type: "POST",
                           url: "contact.php",
                           data: str,
                           success: function(msg){

        $("#note").ajaxComplete(function(event, request, settings){
        $("#note").show();
        if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
        {
        result = '<span class="notification_ok">Your message has been sent. Thank you!</span>';
        $("#fields").hide();
        }
        else
        {
            result = msg;   

        }

        $(this).html(result);

        });

        }
                         });

        return false;

        });

    });

您可以将此表单包含在您的页面中,首先隐藏它,然后在执行某些操作时将其带到屏幕中间并提交它,如果这是您想要的..

You can try something like this :

$(document).ready(function(){
        $("form#contact").submit(function(){

        var str = $("form#contact").serialize();

                           $.ajax({
                           type: "POST",
                           url: "contact.php",
                           data: str,
                           success: function(msg){

        $("#note").ajaxComplete(function(event, request, settings){
        $("#note").show();
        if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
        {
        result = '<span class="notification_ok">Your message has been sent. Thank you!</span>';
        $("#fields").hide();
        }
        else
        {
            result = msg;   

        }

        $(this).html(result);

        });

        }
                         });

        return false;

        });

    });

You can include this form inside your page, hide it at first then upon some action bring it to the middle of the screen and submit it, if that is what you want ..

绝對不後悔。 2024-08-27 17:21:04

另一种选择是获取点击处理程序中的变量,然后将它们传递到 contact.php 页面。例如:

$('#contact-form input.contact, #contact-form a.contact').click(function (e) {
    e.preventDefault();

    var data = 'foo'; // GET VARIABLES HERE

    // load the contact form using ajax
    $.get("data/contact.php?data=" + data, function(data){

然后在您的 contact.php 页面中,您需要取出数据来使用。

The other option is to grab the variable in the click handler and then pass those to the contact.php page. For example:

$('#contact-form input.contact, #contact-form a.contact').click(function (e) {
    e.preventDefault();

    var data = 'foo'; // GET VARIABLES HERE

    // load the contact form using ajax
    $.get("data/contact.php?data=" + data, function(data){

Then in your contact.php page, you'd need to get the data out to use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文