title: Passing textBox to java script function
body: <p>My question might be little old but I tried all the possibilities and could not find any solution. 
  I want to do one function for verification the input field: 
  This function works fine: </p>
  
  <pre><code>function myFunction()
  {
      var x;
      x = document.getElementById('&lt;%=textBoxCustomerCode.ClientID%&gt;').value;
      if(isNaN(x) || x == "")
      {
          alert('Problem input');
          return false;
      }
      else
      {
          return true;
      }
  }
  </code></pre>
  
  <p>and here is the code: </p>
  
  <pre><code>&lt;asp:ImageButton ID="imageButtonView" runat="server" Height="60px" ToolTip="بحث" Width="60px" BorderStyle="Solid" ImageUrl="~/Images/searchButton.jpg" OnClick="imageButtonView_Click" OnClientClick="return myFunction();"/&gt;
  </code></pre>
  
  <p>This function works fine but once I need to make the function works with any input field. I want way to pass any field to the function so it will verify it. Any idea to do so.  </p>