Connecting Tech Pros Worldwide Forums | Help | Site Map

How can i do this

Newbie
 
Join Date: Nov 2008
Posts: 12
#1: 3 Weeks Ago
i am trying to pass the a variable "oneone" from a select box to a php page via java script. this is my html

Expand|Select|Wrap|Line Numbers
  1.  
  2. <div id="wrapper">
  3. <div id="content">
  4. <form>
  5. Select a Customer:
  6. <select id="oneone" name="oneone" value="">
  7. <option value="s_last">last</option>
  8. <option value="s_first ">first</option>
  9. <option value="c_city">cirty</option>
  10. </select>
  11. </form>
  12.  
  13. <div>
  14. <form method="get" action="" class="asholder">
  15.     <small style="float:right">Hidden ID Field: <input type="text" id="testid" value="" style="font-size: 10px; width: 20px;" disabled="disabled" /></small>
  16.     <label for="testinput">Person</label>
  17.     <input style="width: 200px" type="text" id="testinput" value="" /> 
  18.     <input type="submit" value="submit" />
  19. </form>
  20. </div>
  21. </div>
  22.  
this is my javascript

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3.  
  4.     var options = {
  5.         script:"test.php?json=true&limit=6&",
  6.         varname:"input",
  7.         json:true,
  8.         shownoresults:false,
  9.         maxresults:6,
  10.         callback: function (obj) { document.getElementById('testid').value = obj.id; }
  11.             };
  12.  
  13.     var as_json = new bsn.AutoSuggest('testinput', options);
  14.  
  15.         var optionsa = {
  16.         script:"test.php?",
  17.         varname:"one",
  18.         json:false
  19.         };
  20.     var as_jsona = new bsn.AutoSuggest('oneone', optionsa);
  21. </script>
  22.  
and the little part of my php
Expand|Select|Wrap|Line Numbers
  1. $input =$_GET['input'];
  2. $q =$_GET["one"];
  3.  

can someone PLEASE tell my why i cant get this to work!!!

Reply