onClick in a form question

Results 1 to 2 of 2

Thread: onClick in a form question

  1. #1
    Join Date
    Dec 1969

    Default onClick in a form question

    After several hours of searching through JS FAQs, and several days back on this board, I have finally given up and decided to just post my question. I am attempting the impossibly simple, and as such, it is not working - or it could just be my newness to JS.<BR>Anyway, I would like to be able to run a search on a specified web site based on the text entered on my page. This is just an html file on my local hard drive that I use as my "start page", sort of like a personal portal.<BR>Here is my code:<BR>&#060;FORM&#062;<BR>Look it up:&#060;INPUT TYPE="text" NAME="word" SIZE=20&#062; <BR>&#060;INPUT TYPE="button" VALUE="on Dictionary.com" onClick="window.open(&#039;http://www.dictionary.com/cgi-bin/dict.pl?term=&#039;+this.form.word)"&#062;<BR>&#06 0;/FORM&#062;<BR>The result is a new window, with the url exactly as specified, except that the value "[object]" is inserted onto the end of the line instead of what I type into the text box. Obviously, I am not passing the value into the script properly. Any answers are appreciated.... I am prepared to slap my forehead with my open palm, and exclaim, "DO&#039;H" upon receipt of your answer.<BR>Thanks,<BR>Jim

  2. #2
    Join Date
    Dec 1969

    Default this.form.word.value


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts