2011-12-20 78 views
0

提交功能不適用於我,我沒有提醒,請幫助,謝謝。。提交不起作用

<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> 
<div style="background-color:#e7e7e7;width:220px;padding:25px;"> 
    <strong style="font-size:15px;">Do you have a coupon?</strong> 
    <p style="line-height:15.5px;margin-top:2px;text-align:justify;">If you have a coupon to upgrade to Premium membership, enter the coupon code below and click upgrade.</p> 
    <form id="redeem_coupon" action="javascript:void();" method="post"> 
     <input type="text" name="coupon_code" style="border:1px solid #828282;font-size:15px;width:215px;" /> 
     <input type="submit" value="Upgrade" class="button-input" style="margin-left:0;margin-top:5px;"/> 
    </form> 
</div> 
<script type="text/javascript"> 
    $('#redeem_coupon').submit(function() { 
     alert('hi'); 
     return false; 
    } 
</script> 
+2

您的瀏覽器的錯誤控制檯說什麼? – ceejayoz 2011-12-20 22:25:36

回答

7

關閉括號。

$('#redeem_coupon').submit(function() { 
    alert('hi'); 
    return false; 
});