Jake
Jake

Reputation: 3486

.submit not working

the submit function is not working for me, what I have is not being alerted, please help, thanks.

<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>

Upvotes: 0

Views: 126

Answers (1)

nikc.org
nikc.org

Reputation: 16952

Close your parentheses.

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

Upvotes: 7

Related Questions