K
kheston1
Hi,
I'm a ASP C# programmer who never uses javascript and had to try and
move a couple of functions (written by someone else) from one page to
another. The functions work fine, but when I copy them over they fail.
The last message was the the "frm" object did not support the "submit"
method. The function simply takes input from a text box and builds a
little form that it submits to a search site. These are the simplest
things but I can't figure it out - please help! Code is below.
Thanks!!
<script type="text/javascript">
function fnSearchWebstoreDL()
{
var frm = document.createElement("<head><META
name='WebPartPageExpansion'
content='full'></head><form name='frmSearchFormName'></form>");
frm.id = "frmSearchFormName";
frm.method = "GET";
frm.action = "http://webstore/webstoresupport/simplesearch.aspx";
var inpt = document.createElement("<input name='SearchFor'>");
inpt.id = "idSearchString";
inpt.value = document.all("txtSearchWebstoreDLFor").value;
frm.appendChild(inpt);
document.body.appendChild(frm);
frm.submit();
}
</script>
<body>
<table>
<tr>
<td>
<label>Webstore Support:</label>
<input id='Text1' type="text" name="txtSearchWebstoreDLFor"
size="25"
onkeypress="if(window.event.keyCode=='13')return(fnSearchWebstoreDL())"/</td>
</tr>
</table>
</body>
I'm a ASP C# programmer who never uses javascript and had to try and
move a couple of functions (written by someone else) from one page to
another. The functions work fine, but when I copy them over they fail.
The last message was the the "frm" object did not support the "submit"
method. The function simply takes input from a text box and builds a
little form that it submits to a search site. These are the simplest
things but I can't figure it out - please help! Code is below.
Thanks!!
<script type="text/javascript">
function fnSearchWebstoreDL()
{
var frm = document.createElement("<head><META
name='WebPartPageExpansion'
content='full'></head><form name='frmSearchFormName'></form>");
frm.id = "frmSearchFormName";
frm.method = "GET";
frm.action = "http://webstore/webstoresupport/simplesearch.aspx";
var inpt = document.createElement("<input name='SearchFor'>");
inpt.id = "idSearchString";
inpt.value = document.all("txtSearchWebstoreDLFor").value;
frm.appendChild(inpt);
document.body.appendChild(frm);
frm.submit();
}
</script>
<body>
<table>
<tr>
<td>
<label>Webstore Support:</label>
<input id='Text1' type="text" name="txtSearchWebstoreDLFor"
size="25"
onkeypress="if(window.event.keyCode=='13')return(fnSearchWebstoreDL())"/</td>
</tr>
</table>
</body>