Well I've used this code a million times before and for some reason it's not working. Below is the form. I have tried the JS in both the head and in the body of the page.
The JS function is being called. I just put an alert into the function with all other lines of code commented out and an alert appeared. As soon as I include the line that gets the value from the textfield nothing happens.
Perhaps the problem is the html syntax error: id-"searchString"
Note the minus sign instead of an =
Cheers
Oh wow. If it is that I'll be a little annoyed, I spent a while looking at it trying to figure it out. Will try it out on Monday and let you know if it fixes it
John wrote:There is no such function as document.getElementByName()
But there is a document.getElementsByName method. I don't know if oscardog meant to use the document.getElementsByName() method. Upon looking back over oscardog's code though, the function was misspelled by not adding an s to Elements.
I agree that getElementById() would be the better choice there though.
John Cartwright wrote:There is no such function as document.getElementByName(), what you probably want is document.getElementById()
Yeh I know, a typing error.
I had been using document.getElementById() on most of the attempts but as that wasnt' working I decided to try the other (which clearly wouldn't work if I mispelt it!).
Anyway I'll correct all these things on Monday and try it out