Ajax - form select onchange and window load

Ajax - form select onchange and window load

I have a bit of code for an ecommerce website were developing at the moment when a user lands on the product details page they have the option to select a clothing size. Once the size is selected it shows the price and whether it is in stock. This is triggered by an onchange event on the select menu.

When the page loads the first size auto selected but doesn't display the contents i.e price and stock level. is there anyway i can simply show this information when the pages loads? any help greatly appreciated.

  1.                     function showProducts(str) {
  2.                         if (str == "") {
  3.                             document.getElementById("txtHint").innerHTML = "";
  4.                             return;
  5.                         } else {
  6.                             if (window.XMLHttpRequest) {
  7.                                 // code for IE7+, Firefox, Chrome, Opera, Safari
  8.                                 xmlhttp = new XMLHttpRequest();
  9.                             } else {
  10.                                 // code for IE6, IE5
  11.                                 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  12.                             }
  13.                             xmlhttp.onreadystatechange = function() {
  14.                                 if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  15.                                     document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
  16.                                 }
  17.                             };
  18.                             xmlhttp.open("GET","<?php echo ROOT; ?>ExtraProducts.php?q="+str,true);
  19.                             xmlhttp.send();
  20.                         }
  21.                     }