Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Piotrbaz

  • Rank
  • Birthday 06/07/1989

Previous Fields

  • Languages

Profile Information

  • Location
  • Interests
    OOP PHP, websites, sports (speedway!)
  1. Haha I knew it must have been something that simple Thank you all so much for your help Problem solved !
  2. Sorry I checked it with chrome tools and got this: - Uncaught SyntaxError: Unexpected string (which is that xmlhttp.open function call)- Uncaught ReferenceError: showUser is not definedonchange (which of course is about that second select tag) Also:0 / 3 requests ❘ 0B / 1.56KB transferred ❘ 129ms (onload: 153ms, DOMContentLoaded: 125ms)
  3. Still nothing :(So far nobody has said anything about xmlhttp.open function call. Is everything ok with it ? xmlhttp.open("GET","getuser.php?q="+user"&s="+salary,true);
  4. Well, sounds great but doesn't seem to work ;xI've made a small change, instead of "age" I've put a salary field. SELECTs <body><form><select id="users"><option value="">Select a person:</option><option value="1">Lois Griffin</option><option value="2">Glenn Quagmire</option></select><select id="salary" onchange="showUser()"><option value="">Select salary</option><option value="2000">2000</option><option value="4000">4000</option></select></form><br /><div id="txtHint">
  5. I figured it would be something like this: SELECT PART: <select name="users"><option value="">Select a person:</option><option value="1">Lois Griffin</option><option value="2">Glenn Quagmire</option></select> <select name="age" onchange="showUser(? , this.value)"><option value="">Select age</option><option value="20">20</option><option value="40">40</option></select> I've put 'onchange' attribute into the second select tag, because I want to call the showUser function after the 'age' dropdown is
  6. Hmm, I was rather thinking about, (for example), selecting a person ($x), then its age ($y) (from 2nd dropdown) and sending those two variables together to .php file. So my query gets two variables to work with.The result shown would be person(s) aged $y.Like this: Hope I made it more clear
  7. Hello I've got a question about "AJAX Database Example" from w3schools page (linked here -> http://www.w3schools...ax_database.asp ) All works perfectly fine, but I want to adjust it to TWO select dropdowns and show the results only after the second one is selected (I pick the first select, then second one and after that results are shown). The problem is, I don't know exactly what I need to change in showUser function. Of course it needs to take 2 parameters and I have to create second select dropdown outside the function, but my knowledge about AJAX is too poor to make it work ; / Will
  • Create New...