All of the tutorials I see online are defining functions on the fly to respond to event handlers. I am trying to call a JS function when my form is submitted, but it never works quite right. In PHP:
echo "$(document).ready(function() { $(\"#newDate\").submit( ValidateForm('".$ID."') ); });";
When the user hits enter for the input field, instead of submitting my form I need it to call a javascript function. This line of code repeatedly calls my function in an infinite loop.