I have reason to use a text field outside of a <formtag, but I'm
having trouble checking the value of the form. The idea is to grab the
field value and append it to a redirect.
The problem is I can't get the field value. Here's the code I'm trying
to use:
in my .aspx page:
<td width="140"><input type="text" name="searchString"
id="SearchString" class="smallFont" style="width: 135px;" /></td>
<td width="25" align="right"><input type="image" name="searchButton"
id="searchButton" src="/_images/goButton.gif" onclick="submitSearch()"
/></td>
in my .js file:
function submitSearch() {
alert(document.getElementById('searchString').valu e);
}
When i click the searchButton image, I get the following javascript
error:
Error: document.getElementById("searchString") has no properties
any ideas?? I've checked multiple websites and believe this is the
right method of doing this, but well.. I get the error.