Hi, I'm trying to pass the value of a radio button to a function when a textarea detects a keypress event. I can't figure out why this error is happening though...
Code:
Error: SyntaxError: missing ) after argument list
Line: 1, Column: 29
Source Code:
getMoreInfoResults(this.value; document.question_form.vote.value;)
HTML Code:
<div id="pollElement"><h3>Do you like money?</h3><form name="question_form"><input type="radio" name="vote" value="1" onclick="getVote(this.value)" />Yes<br /><input type="radio" name="vote" value="2" onclick="getVote(this.value)" />No<br /><h3>Why?</h3><textarea rows="3" name="moreInfo" onkeyup="getMoreInfoResults(this.value; document.question_form.vote.value;)" /></textarea><br /><input type="submit" value="Submit" /><div id="otherAnswers">You can optionally type an answer.</div></form></div>
Code:
function getMoreInfoResults(input, int) {
if (window.XMLHttpRequest)
{ // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("otherAnswers").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","phpPoll/phpPoll_userDefined/functions/getMoreInfoResults.php?moreInfo="+input,true);
xmlhttp.open("GET","phpPoll/phpPoll_userDefined/functions/getMoreInfoResults.php?vote="+int,true);
xmlhttp.send();
}
Hi, I'm trying to pass the value of a radio button to a function when a textarea detects a keypress event. I can't figure out why this error is happening though...
Code:
Error: SyntaxError: missing ) after argument list
Line: 1, Column: 29
Source Code:
getMoreInfoResults(this.value; document.question_form.vote.value;)
HTML Code:
<div id="pollElement"><h3>Do you like money?</h3><form name="question_form"><input type="radio" name="vote" value="1" onclick="getVote(this.value)" />Yes<br /><input type="radio" name="vote" value="2" onclick="getVote(this.value)" />No<br /><h3>Why?</h3><textarea rows="3" name="moreInfo" onkeyup="getMoreInfoResults(this.value; document.question_form.vote.value;)" /></textarea><br /><input type="submit" value="Submit" /><div id="otherAnswers">You can optionally type an answer.</div></form></div>
Code:
function getMoreInfoResults(input, int) {
if (window.XMLHttpRequest)
{ // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("otherAnswers").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","phpPoll/phpPoll_userDefined/functions/getMoreInfoResults.php?moreInfo="+input,true);
xmlhttp.open("GET","phpPoll/phpPoll_userDefined/functions/getMoreInfoResults.php?vote="+int,true);
xmlhttp.send();
}
Does anyone know why this is happening?
Thanks
what those semicolons are doing in firing method? it should be colon, and just one, functionName(attr1, attr2)
Bookmarks