I have a simple form that looks like this:
<form action="#" name="submit" method="post"> <input name="zip" id="zip" type="text" value="" class="zip-start" /> <div class="form-submit"><a href="" id="zipformSubmit" rel="zipformSubmit" class="zipformSubmit">Submit</a></div> </form> I have JS that looks like this:
<script> $(document).ready(function() { $("a[rel=zipformSubmit]").click(function(e) { e.preventDefault(); var zip = $('#zip').val(); if (zip.length < 5) { alert("Please enter a valid zip code"); return false;}; $.colorbox({href: "/ppc/form.htm?zip=" + zip, iframe:true, innerWidth:800, innerHeight:600}); }); }); </script> The problem is that the user can only submit this form by clicking on the submit button. Any ideas on how i can adjust the js so that the enter button also submits the form?
thanks in advance