Web Analytics Made Easy -
StatCounter dropdown onchange to select mysql with php - CodingForum

Announcement

Collapse
No announcement yet.

dropdown onchange to select mysql with php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • dropdown onchange to select mysql with php

    Hello There,
    I am trying to create a dropdown that selects mysql with php. For example I have two select dropdowns the first with types and second with products. So when the types select is click the products from that category are listed in the product select.
    Code:
    <select name="type" id="type">
    <option value="1">Accessories</option>						
    <option value="2">Cables</option>						
     </select>
    <select name="product_item"  id="product_item">
    <option value=""></option>
    </select></p>
    Thanks,
    Ryan

  • #2
    To clarify, are you asking how to retrieve data through an XMLHttpRequest call via PHP/MySQL and populate the contents, or how to change it around using the DOM once PHP has already built the structure?

    Comment


    • #3
      Or do you simply want to post back to PHP after the first <SELECT> is changed and then regenerate the entire page with the new second <SELECT>? That's probably the easiest way for a newbie to approach the problem.
      Be yourself. No one else is as qualified.

      Comment

      Working...
      X