test onclick in a function
<p><strong>Quick question</strong>: How do i check if a submit button is clicked in a function.</p>

<p><strong>explained question</strong>:
ok, so I have a validate script for my sign-up page. The validate function is run onblur of every input (after the submit button has been clicked first). </p>

<p>However, the validate script not only gives the inputs a red background if the correct information hasn't been entered, but it also displays an alert message. </p>

<p>My problem is: I only want to display the alert message if the submit button is clicked, otherwise i just want to do change the background color. So how do I check if a submit buttons is clicked, in a function. 
I could just have two different functions, one to be run for all the inputs. and one to be run for the submit button. </p>
