Forum Moderators: open
<script type="text/javascript">
document.write("<input type='hidden' name='pagetitle' value='" + document.title + "'>");
</script>
If you're writing XHTML, just remember to include the closing slash:
<script type="text/javascript">
document.write("<input type='hidden' name='pagetitle' value='" + document.title + "' />");
</script>
FYI,
Exactly what I was trying to do was pass Y!Q (Yahoo's context search) the page title for context. This is in leu of enclosing part of the page text within the Value attribute.
Due to the content on this site, the page titles give far better results and I simply wanted a way to code a var as opposed to hard coding.... works great now.
Thanks all.