View Single Post
May11-07, 08:54 PM   #6
 
Recognitions:
Science Advisor Science Advisor
Since your input object only has a name property (and no ID)
Code:
<INPUT name=keywords>
You can use the following to get its value:
Code:
document.getElementsByName('keywords')[0].value
So in your code you'd have:
Code:
<SCRIPT type=text/javascript>
      $(document).ready(
        function(){
          $("//p#b1/a").click(
            function(){
              $("//div#content").empty();
              $("//div#content").load("hello.php?hello=" + document.getElementsByName('keywords')[0].value);

            }
          )
        }
      )
    </SCRIPT>
If you give your input control an ID:
Code:
<INPUT name=keywords id=keywords>
You can use the following to get its value:
Code:
document.getElementById('keywords').value;
Or you can use jquery:
Code:
$("input#keywords").val()
And you'd have, after giving your control an ID:
Code:
<SCRIPT type=text/javascript>
      $(document).ready(
        function(){
          $("//p#b1/a").click(
            function(){
              $("//div#content").empty();
              $("//div#content").load("hello.php?hello=" + $("input#keywords").val());

            }
          )
        }
      )
    </SCRIPT>