Forum Moderators: open
<script runat="server">
public faqid as string=""
</script>
<!-- Comments Box -->
<form name="commentsform" id="commentsform" method="post" action="getcomment.aspx?faqid=<%=faqid%>" target="frmGetcomments">
<script type="text/JavaScript">
function deletecomment(){
if (document.getElementById("comment").value.indexOf('[Optional Comment]')==0) document.getElementById("comment").value='';
}function setrating(what){
document.getElementById("rating").value=what;
}
function submitcomment(){
if (document.getElementById("rating").value=='0'){
alert('Please rate this article before submitting');
} else {
deletecomment();
document.getElementById("commentsform").submit();
document.getElementById("commentstable").innerHTML='<b>Thank you for your feedback!.</b><br>We will evaluate it shortly and use it to help us improve our knowledge base';
}
}
</script>
<table width="100%" border="0" align="center" cellpadding="6" cellspacing="0" class="CellBorder">
<tr>
<td class="CellHeader"><span id="commentstable"><b>How would you rate this
article?</b><br>
<table border="0" cellpadding="0" cellspacing="0" class="SmallText">
<tr>
<td><br>
Poor</td>
<td align="center"> 1<br>
<input type="radio" name="chkRating" onclick="javascript:setrating(1);">
</td>
<td align="center">2<br>
<input type="radio" name="chkRating" onclick="javascript:setrating(2);"></td>
<td align="center">3<br>
<input type="radio" name="chkRating" onclick="javascript:setrating(3);"></td>
<td align="center">4<br>
<input type="radio" name="chkRating" onclick="javascript:setrating(4);"></td>
<td align="center">5<br>
<input type="radio" name="chkRating" onclick="javascript:setrating(5);"></td>
<td><br>
Great</td>
<td><input name="rating" type="hidden" id="rating" value="0"></td>
</tr>
<tr>
<td colspan="7"><textarea name="comment" rows="2" style="width:100%" onclick="javascript:deletecomment();">[Optional Comment]</textarea></td>
<td> <a href="javascript:submitcomment();"><img src="images/btnFaqSubmitComment.gif" alt="Submit" width="32" height="32" hspace="4" border="0"></a></td>
</tr>
</table>
</span></td>
</tr>
</table>
<iframe id="frmGetcomments" name="frmGetcomments" src="blank.htm" width=0 height=0></iframe>
</form>
The code above allows a user to click on a button (1-5) as well as leave a comment about how helpful somethning was. In IE it works without any problems... but in FireFox 2.0 it does absolutely nothing.
Any ideas?
<script type="text/JavaScript">
function deletecomment(){
if (document.getElementById("comment").value.indexOf('[Optional Comment]')==0) document.getElementById("comment").value='';
}function setrating(what){
document.getElementById("rating").value=what;
}
function submitcomment(){
if (document.getElementById("rating").value=='0'){
alert('Please rate this article before submitting');
} else {
deletecomment();
document.getElementById("commentsform").submit();
document.getElementById("commentstable").innerHTML='<b>Thank you for your feedback!.</b><br>We will evaluate it shortly and use it to help us improve our knowledge base';
}
}
</script>
to the following:
<script type="text/JavaScript">function setrating(what){
document.getElementById("rating").value=what;
}
function submitcomment(){
if (document.getElementById("rating").value=='0'){
alert('Please rate this article before submitting');
} else {
document.getElementById("commentsform").submit();
document.getElementById("commentstable").innerHTML='<b>Thank you for your feedback!.</b><br>We will evaluate it shortly and use it to help us improve our knowledge base';
}
}
</script>
I can get FireFox submitting the form. But without the fuction "deletecomment" it won't automatically delete the comment already in the comments box when a user clicks on it. How can I enable the deletecomment function and still get this working in FireFox?