I want to use the same function if the user submit the #postcode-form or click on #show-results link. How can I do it without duplicate the function?
HTML
<form id="postcode-form">
<input id="postcode" type="text" name="postcode" />
<input type="submit" value="search" />
</form>
<a id="show-results" href="#">Show the results</a>
JAVASCRIPT
$("#show-results").click(function(e){
e.preventDefault();
codeAddress(postcode);
});