I am trying to build a ajax feedback form but I am having problems getting it to display. The feedback image displays but when I click it nothing happens.
My Form:
<div id="feedback">
<img id="feedback_link" src="images/feedback.gif" href="javascript:open('feedback_form_wrapper');" />
<div id="feedback_form_wrapper" style="display:none;">
<a class="close light" style="float:right;margin-right:5px;" href="javascript:open('feedback_form_wrapper');" >CLOSE</a>
<form id="feedback_form" action="." onsubmit="submit(); return false;">
<div style="margin: 8px; width: 184px; float: left;">
<select name="subject">
<option value="bug">Found A Bug</option>
<option value="typo">Found A Typo</option>
<option value="other">Other</option>
</select>
Email:<br/>
<input type="text" class="email" name="email" /><br/>
<textarea name="body" id="feedback_body" style="height: 180px; margin-top: 8px;">Enter Feedback Here.</textarea>
<input type="submit" class="input_submit_button" value="submit" />
</div>
</form>
</div>
</div>
The JavaScript:
function open(id){
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(id).style.display = 'block';
}
else {
if (document.layers) { // Netscape 4
document.id.display = 'block';
}
else { // IE 4
document.all.id.style.display = 'block';
}
}
}
function close(id){
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(id).style.display = 'none';
}
else {
if (document.layers) { // Netscape 4
document.id.display = 'none';
}
else { // IE 4
document.all.id.style.display = 'none';
}
}
}