Actually there are other problems with the page, but perhaps you were messing around with it since you posted. The superpaste function should be:
Code:
function superpaste(){
var writingblock = document.myQueryForm.query;
var degree = document.first_form.degree.value;
var interest = document.first_form.interest.value;
var region = document.first_form.region.value;
var experience = document.first_form.experience.value;
writingblock.value = "Select * from Resume WHERE degree_program = '";
writingblock.value += degree;
writingblock.value += "' AND interest = '";
writingblock.value += interest;
writingblock.value += "' AND region ='";
writingblock.value += region;
writingblock.value += " ' AND experience = '";
writingblock.value += experience;
writingblock.value += "' ;";
}
Aside from the obvious changes (dropped the redundant and illegal multiple var declarations) I also reversed =+ to +=. The former is math assignment meaning literally:
equals positive
The later (when valid) is concatenation or addition, depending upon the values. If strings, as is the case here, concatenation.
And finally, perhaps least obvious, I dropped an extra closing curly bracket:
}
from the end of the function.
Now another thing wrong with the page is this (its onclick event is so full of errors that it is basically meaningless in javascript):
HTML Code:
<input type="button"
onclick="Select * from Resume WHERE degree_program = 'document.first_form.degree.value' AND interest = 'document.first_form.interest.value' AND region ='document.first_form.region.value' AND experience = 'document.first_form.experience.value';"
value="Call function">
It probably should be (now that superpaste works):
HTML Code:
<input type="button"
onclick="superpaste();"
value="Call function">
There still could be other issues.
Bookmarks