【问题标题】:Disable editing a form method禁用编辑表单方法
【发布时间】:2014-12-09 14:52:25
【问题描述】:

我遇到了一个问题,人们可以在连接到贝宝时更改此设置,并且他们可以更改他们可以为他们购买的套装购买的金额。我可以禁用编辑这个或如何我能做些什么来阻止人们编辑这个吗?

<form method="post" name="paypal_form" action="https://www.paypal.com/cgi-bin/webscr">
    <input type="hidden" name="rm" value="2">


    <input type="hidden" name="cmd" value="_xclick">


    <input type="hidden" name="business" value="fliphotell@hotmail.com">


    <input type="hidden" name="return" value="http://fliphotel.org">


    <input type="hidden" name="custom" value="Flowy">
    <input type="hidden" name="cancel_return" value="http://fliphotel.org">


    <input type="hidden" name="notify_url" value="http://fliphotel.org/pp/paypal.php?action=ipn">
    <input type="hidden" name="item_number" value="2">


    <input type="hidden" name="item_name" value="Flip Diamonds">


    <input type="hidden" name="amount" value="7">
    <center><br><br>If you are not automatically redirected to paypal within 5 seconds...<br><br>
    <input type="submit" value="Click Here"></center>

</form>

【问题讨论】:

    标签: javascript jquery html paypal


    【解决方案1】:

    您可以使用 disabled 属性来禁用输入。也许您可以等到连接完成后再删除 disabled 属性。

    <form action="demo_form.asp">
     First name: <input type="text" name="fname"><br>
     Last name: <input type="text" name="lname" disabled><br>
     <input type="submit" value="Submit">
    </form>
    

    【讨论】:

    • $p->add_field('amount', $cost);我怎么能在这个上添加禁用?
    • 如果你真的想要一个有用的答案,你必须更具描述性。我假设这是最终会呈现 HTML 的 PHP。如果是这样,您可以修改 add_field 方法以采用禁用的参数,或者一种hacky方法是通过javascript定位表单并禁用输入。不管怎样,看起来你离得很远。
    猜你喜欢
    • 1970-01-01
    • 2011-03-25
    • 2015-01-24
    • 2018-01-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-15
    • 2016-06-25
    相关资源
    最近更新 更多