title: how do i use splitstring function in javascript?
body: <p>I have created this javascript function</p>
  
  <pre><code>  function fillGaps()
  {
  var selectElement = document.snowForm.snoww;
  var values = selectElement.options[selectElement.selectedIndex].innerHTML;
  var words[] = values.split(" ");
  var firstWord = words[0];
  var secondWord = words[1];
  var thirdWord = words[2];
  
  alert(values);
  
  
  
  document.snowForm.last.value = firstWord;
  document.snowForm.first.value = secondWord;
  document.snowForm.phone.value = thirdWord;
  }
  </code></pre>
  
  <p></p>
  
  <p>So now, please let me explain few things. I have a form which name is snowForm. In this form i have a select element which its options will always be aparted from strings, first name - last name - phone number. </p>
  
  <pre><code>&lt;option value="Malkovic"&gt;John Malkovic 1514 4124&lt;/option&gt;
  &lt;option value="Malkovic"&gt;Chris Davidson 6234 2634&lt;/option&gt;
  &lt;option value="Malkovic"&gt;Bill Parker 3134 2124&lt;/option&gt;
  </code></pre>
  
  <p>etc..</p>
  
  <p>So lets say i pick one of these options and onchange i want my function to fill these 3 input areas</p>
  
  <pre><code>&lt;input type="text" name="last"/&gt;
  &lt;input type="text" name="first"/&gt;
  &lt;input type="text" name="phone"/&gt;
  </code></pre>
  
  <p>with the 3 words that my function split.</p>
  
  <p>My problem is that i think that it should work correctly but it actually does not do anything.</p>
  
  <p>Any help will be highly appreciated. Thank you in advance, Telis.</p>