// this code basically just grabs an input element from a page and gets it's value ... // it matches one input element only ... the function is called by pressing on a corresponding link function sndLead(action,teacher_id,job_id) { http = createRequestObject(); match_id = teacher_id+'-'+job_id ; teacher_match_notes = '' ; teacher_match_arr = new Array() ; teacher_match_arr=getElementsByClass(match_id) ; for( var i = 0 ; i < teacher_match_arr.length ; i++) { teacher_match_notes = teacher_match_arr[i].value; } alert(teacher_match_notes); // problem is that I have, say, 2 input elements on the page each with a different class value. // this code will return the contents of the when I press the button for a second time, regardless of // which of the two elements I call it on ... // why does it output the value of the input on the second call only ?