show information in textbox from mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Noorain
    New Member
    • Mar 2008
    • 57

    show information in textbox from mysql

    Let's say there is an A/C no. in my database and it is is 01234553434.
    I want to type a/c no. into a textbox. When i type then numbers "012", the rest of digits should show up in textbox from database automatically.

    I am using MySQL for a database.
  • chathura86
    New Member
    • May 2007
    • 227

    #2
    well it is all about AJAX and CSS

    what you need to do is place the textbox and use key press event



    on the key press event send an ajax request to server with the entered value
    W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.


    on the server you have a php page where you get the value and search it
    on the database and get the relevant values and sends back to the
    browser

    use js to show these data on the page the way you want.

    here is a good example done with jquery



    try it out and post your code here if you have any problems

    i will try to help you


    Regards

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Moving this to JavaScript as it has more to do with that than PHP.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        We'll see where this ends up being placed but PHP does play a part here.

        When ever the user types a character into the text box you have to make an Ajax request to the server (a PHP script) which will return any matching options based on what the user typed. When the Ajax request is finished, and the browser has received the matches, you will use JavaScript to display the options to the user.

        The articles that chathura86 posted should get you pointed in the right direction.

        Comment

        Working...