Hi there,
I am totally new to Java script (just began to looking into it) and I would like to do something with the comment box on one of the website I am working on http://antobbo.webspace.virginmedia.com/webediting/documents.htm
Basically rather than that box at the bottom of the page I was thinking to have a link saying something like "comment" and if I click on it the text box appears.
Now, this is my html comment box code:
<div class="comment_box">
<form action="mailto:myemail@domain.com" method="post">
<p>Comments and suggestions:<br><textarea name="comments" rows="3" cols="30"></textarea><br><br>
<input type="submit" value="Send"></p>
</form>
</div> <!-- end of comment_box-->
CSS
.comment_box
{
border-style:solid;
border-width:1px;
float:left;
background-color:#d4d4cb;
width:280px;
padding-left:20px;
padding-top:25px;
padding-bottom:10px;
}
and for the script I am not quite sure how to proceed. I suppose the box will need to be shown using a
document.write()
method but does it mean that I have to copy the content of my
<form></form>
into the script? So something like "if I click on the comment button show the box"?
this is what I came up so far, it is not much sorry
<script type="text/javascript">
<!--
function popup() {
document.write() /* not quite sure what to put in it*/
}
//-->
</script>
<body>
</body>
<input type="button" value="Comment" onclick="popup()"><br />
ANy help/suggestion greatly appreciated
thanks