title: Javascript - Calling two onClick functions
body: <p>I have this submit button on my website.</p>
  
  <pre><code>&lt;form name="bbsform" action="&lt;?=$PHP_SELF?&gt;" method="post"
  &lt;input type="submit" value="Submit" onclick="this.disabled=true,this.form.submit();" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The onClick part disables the submit button immediately after the first click, to prevent possible double submission of the form. And it perfectly works.</p>
  
  <p>And I also have made this javascript function, too. Let's say it's called <strong>'Guidance(bbsform)'</strong>. </p>
  
  <p>Briefly, when a user forgot to complete one field in the form, it shows an alert message and focuses to the field. 
  (It work like that some invisible cursor is automatically clicking on the field, so the user can start typing right away.) This function works great too. </p>
  
  <p>They both work great, well at least separately.</p>
  
  <p>But when I combine them like this :</p>
  
  <pre><code>onclick="return Guidance(bbsform);this.disabled=true,this.form.submit();"
  </code></pre>
  
  <p>Only the <strong>Guidance</strong> function properly works.</p>
  
  <p>Could you tell me what's wrong with the code?</p>
  
  <p>Thank you for reading. I'm a newbie to this whole programming thing, so please be generous :)</p>
  
  <p><strong>Here is the Guidance function.</strong> Sorry none of the solutions worked.. It's really frustrating.</p>
  
  <pre><code>function Guidance(frm){
  
  if(frm.subject.value == ""){
  
  alert("Please complete the title field.");
  
  frm.subject.focus();
  
  return false;  }
  
  
  try{ content.outputBodyHTML(); } catch(e){ }
  
   if(frm.content.value == ""){
  
      alert("Please complete the message field.");
  
  frm.content.focus();    return false;  }
  </code></pre>