SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to execute a query depending on the value selected

    hi,

    how to populate the other fields by executing a query depending on the value selected in the list box.

    I have a list box which is getting the values from the database.

    For example:

    student Id

    st01
    st02
    st03

    if the user selected st01 in the list it should populate the the student name and branch in the below two text boxes

    Thanks
    Samiuddin

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,183
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    From how you explained it this is what you want...

    User selects a value from the drop down box
    vvvvv
    Upon selecting a value 2 text boxes are then populated with data synced to that user

    Did i hit the nail on the head? If i did you would either need to use a static JavaScript .innerHTML() method or use Ajax to dynamically receive the data but using innerHTML would be a lot easier and faster.
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your response,

    when the student selected the Id from the list box then i want to populate his name and branch from the database table in the below two form fields



    please provide me the code



    Thanks
    samiuddin

  4. #4
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,200
    Mentioned
    105 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by samiuddin.adse View Post
    please provide me the code
    I think it would be more beneficial to you in the long run if you tried to figure it out. SgtLegend gave you the terms to search for, either in google or here. They will lead you down the right path.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  5. #5
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,183
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Right now i have a snippet of untested code but it does help a lot more to search for the correct code elements yourself as in my personal opinion you get no where if you copy what others write.
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle


Bookmarks

Posting Permissions

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