【问题标题】:jQuery .val Cyrillic Values Passed to PayPal Form FieldjQuery .val Cyrillic 值传递给 PayPal 表单字段
【发布时间】:2013-07-13 22:58:00
【问题描述】:

以下是我正在开发的一项功能的简化版本。如果有人可以提供帮助,我可以轻松地将其适应我的现实世界情况。

在我的示例中,如果提交表单时在 JavaScript 中激活了英文版 input[id=item_name],则它可以工作。启用俄文版的 input[id=item_name] 后,它就不起作用了……问题是当您最终使用 PayPal 时,描述是 Gobbledygook。

如果您在每个版本的 input[id=item_name] 活动的情况下提交表单,您将在访问 PayPal 时看到问题(在描述上)。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>


<form action="https://www.paypal.com/cgi-bin/webscr" method="post" accept-charset="UTF-8">

<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="email@website.com">
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="RU">
<input type="hidden" name="item_name" id="item_name" value="">
<input type="hidden"name="amount" id="amount" value="">
<input name="submit" type="submit" value="Submit">
</form>


<script type="text/javascript">


/*This Doesn't Work*/
$('input[id=item_name]').val('50 слов перевода');

/*This Does Work*/
/*$('input[id=item_name]').val('50 Word Translation');*/


$('input[id=amount]').val('5.00');      
</script>


</body>
</html>

【问题讨论】:

    标签: javascript jquery forms paypal cyrillic


    【解决方案1】:

    您能否在表单中添加一个额外的输入字段并查看它是否有任何变化?

    <input type="hidden" name="charset" value="utf-8"> 
    

    也检查一下:http://www.nopcommerce.com/boards/t/19293/paypal-greek-characters.aspx#84782 我目前无法访问 PP 沙盒,否则我会尝试提供更多帮助。

    【讨论】:

    • 这绝对有效,谢谢。有时你只是盯着某件事太久。谢谢,谢谢:)
    猜你喜欢
    • 1970-01-01
    • 2014-05-26
    • 2010-12-25
    • 1970-01-01
    • 1970-01-01
    • 2018-12-01
    • 2012-05-21
    • 1970-01-01
    • 2013-02-25
    相关资源
    最近更新 更多