0

最初に感謝します。私は多くのモーダルフォームを検索しましたが、あなたのフォームの方が使いやすく、変更しやすいようです。

私の唯一の質問は、ダウンロードしたお問い合わせフォームのバージョンを使用して、モーダルフォームとモーダルフォーム自体を呼び出すページから動的変数を送信する方法です。

jsファイル(contact.js)を調べてモーダルを表示すると、リンクを直接取得して、varを送信するにはどうすればよいですか?

私の悪い英語でごめんなさいそして前もって感謝します

ジュリアン

4

2 に答える 2

0

もう 1 つのオプションは、クリック ハンドラーで変数を取得し、それらを 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 ページで、使用するデータを取得する必要があります。

于 2010-02-13T16:26:04.857 に答える
0

次のようなものを試すことができます:

$(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;

        });

    });

このフォームをページ内に含め、最初に非表示にしてから、何らかのアクションで画面の中央に移動して送信することができます..

于 2010-02-10T09:53:10.313 に答える