title: Ajax and php Question
body: <p>Finally got my domain checker working. Now the question is I have a form (search-domains) when user types and submits at the moment it passes the query to process.php and that out puts:
  echo "$Domain is/isn't available"</p>
  
  <p>What I want is this to return on my results page (the results page also has a search form on it so if someone searches there it would display on same page). At the moment when user clicks it passes <a href="http://example.com/process.php?domain=domain.com(etc" rel="nofollow">http://example.com/process.php?domain=domain.com(etc</a>...).</p>
  
  <p>What i think i need is Ajax to pull this url before it goes to process.php then ajax runs the query process sends result back to ajax an it outputs on the results page. Also I have another php script which displays the domain with different tlds and displays id they are available or not. So i also need ajax to run this and display aswell.</p>
  
  <p>I am very new to ajax but looking for tutorials but most of them are for displaying success messages after contact forms and the like. If someone could point me in the right direction id much appreciate it. </p>
  
  <p>EDIT</p>
  
  <p>This is what i have but itsd still re-directing me to process.php</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;form method="get" id="form"&gt;
     &lt;input type="text" class="searchdomains" onclick="if (this.value =='Domain Name Search...'){this.value=''}" value="Domain Name Search..." name="domain" id="search-domain-input"&gt;
     &lt;input type="image" src="&lt;?php bloginfo('template_url'); ?&gt;/inc/img/btn_up_search.png" class="search" name="Search" id="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>JQuery</p>
  
  <pre><code>$.ajax(
   {
    type: 'GET',
    url : "http://example.com/process.php?domain=",
     // here you pass js object in convention: { 'query_string' : 'its value' }
    data : { 'domain' : $('#search-domain-input').val() },
    success: function (data) {
  
  
      $("#results").html(data);
    }
   }
  
  );
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>if(isset($avail)){
     echo '&lt;p&gt;'.$avail.' is available to be registered&lt;/p&gt;'
  } else {
     echo '&lt;p&gt;'.$avail.' is taken register with us for price&lt;/p&gt;'
  }
  </code></pre>
  
  <p>Thanks
  Joe</p>