title: How to cancel this js function
body: <pre><code>&lt;script type="text/javascript"&gt;
      window.onload=function()
      {
          var el=document.getElementById('affiliate_0');
          el.onclick=function(){
              var my_text=prompt('Enter: Name - Email');
              if(my_text)     
                  window.open("http://affiliateaddress&amp;subid1="+my_text)
          }
  
          var el2=document.getElementById('affiliate_1');
          el2.onclick=function(){
              var my_text=prompt('Enter: Name - Email');
              if(my_text)
                  window.open("http://affiliateaddress="+my_text)
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>This function gets through even when the user presses cancel. I do not want that. Please help.</p>