title: Jquery Ajax based search
body: <p>I want to do the search using ajax jquery js, for that <a href="http://www.developphp.com/view.php?tid=1143" rel="nofollow">I have taken this piece of code from here</a>:- </p>
  
  <p>Now i have some issues, I have this Javascript code:-</p>
  
  <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt;
  &lt;!--
  function searchuser(cv) {
      $("#SearchResult").html('&lt;img src="loader.gif"/&gt;').show();
      var url = "elements/search-user.php";
      $.post(url, {contentVar: cv} ,function(data) {
         $("#SearchResult").html(data).show();
      });
  }
  //--&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>My Form:-</p>
  
  <pre><code>&lt;label&gt;
          &lt;input onClick="generatenew();" type="radio" name="search_option" value="code" id="search_option_0"&gt;
          Customer Code&lt;/label&gt;&lt;/td&gt;
        &lt;td&gt;&lt;label&gt;
          &lt;input onClick="generatenew();" type="radio" name="search_option" value="company" id="search_option_1"&gt;
          Customer Company&lt;/label&gt;&lt;/td&gt;
        &lt;td&gt;&lt;label&gt;
          &lt;input onClick="generatenew();" type="radio" name="search_option" value="name" id="search_option_2"&gt;
          Customer Name&lt;/label&gt;&lt;/td&gt;
        &lt;td&gt;&lt;label&gt;
          &lt;input onClick="generatenew();" type="radio" name="search_option" value="email" id="search_option_3"&gt;
          Customer Email&lt;/label&gt;
  </code></pre>
  
  <p>This is my search textbox</p>
  
  <pre><code>&lt;input type="text" name="searchuser_text" id="newInput" size="25" maxlength="25" class="inputbox MarginTop10"&gt;
  </code></pre>
  
  <p>This is my search button</p>
  
  <pre><code>&lt;input onclick="javascript:searchuser('con1');" class="Button" name="search_user_submit" type="button" value="Search"&gt;
  </code></pre>
  
  <p>This is my Display Area :-</p>
  
  <pre><code>&lt;div id="SearchResult"&gt;My default content for this page element when the page initially loads&lt;/div&gt;
  </code></pre>
  
  <p>Now i want to know on click of button i am sending a data i.e. <code>con1</code>. I want to send two data to the <code>searchuser function</code>, one the selected option button value and the another one is the text in the <code>textbox</code>. After sending both the data to the function how will i get the data in the function? Do i need to change the <code>function searchuser(cv)</code> to <code>function searchuser(cv, cvtwo)</code>.</p>
  
  <p>Also while the <code>$.post(url, {contentVar: cv} ,function(data)</code> is sending only one data to the php file, how can i send both the data i.e. <code>cv</code> and <code>cvtwo</code> to the php file?</p>