2

我已经在 tpl 文件中添加了一个 jquery 脚本,即使使用文字标签它也无法正常工作 错误是什么?

<script type='text/javascript'>
{literal}
jQuery(document).ready(function()
{jQuery.validator.setDefaults(
{debug: true,success: "valid"});
$( "#PayformRIP" ).validate({rules: {
rip: "required",
rip2: {
  equalTo: "#rip"
}}});

$( "#dialogForUser" ).dialog({
        autoOpen: false,
        show: "blind",
        hide: "explode",
        title: "receive your money",
        width: 500,
        height:300
});


$( "#link" ).click(function() {
    var dialogWidth = $(this).attr('dialogWidth');
    var dialogHeight = $(this).attr('dialogHeight');

    $( "#dialogForUser" ).dialog( "option", "width", dialogWidth );
    $( "#dialogForUser" ).dialog( "option", "height", dialogHeight );
    $( "#dialogForUser" ).dialog( "open" );
    return false;
});
var rip = $('<div />').html('</br><form id="PayformRIP" method="post" action="" >RIP de votre compte:<input type="text" required="true" name="rip" class="input" ><p id="titre" >RIP de votre compte:</p><input type="text" required="true" id="rip2" name="rip2" class="input" ><input type="submit" id="ripbutton" name="ripbutton" ></form>');
var paypal = $('<div />').html('</br><form id="PayformPAL" method="post" action="" >Email Paypal:<input type="email" required="true" name="paypal" class="input" ></br>Email Paypal:<input type="email" required="true" name="paypal" class="input" ><input type="submit" name="paybutton" id="paybutton"   ></form>');rip.id = 'rip';paypal.id = 'rip';$('input:radio[name="postage"]').change(
function(){


    if ($(this).val() == 'paypal') {

        // appends the 'appended' element to the 'body' tag
         $(rip).remove();
        $(paypal).appendTo("#dialogForUser");
    }
    else {

        // if it's the 'No' button removes the 'appended' element.
        $(paypal).remove();
        $(rip).appendTo("#dialogForUser");
    }
});


});
{/literal}

这是我的代码,我正在等待您的建议,因为我尝试了很多但没有好的结果。

4

1 回答 1

0
于 2013-10-23T18:05:55.943 回答