SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Auto complete fields if a user is found help

    Hi,
    I have a Patient intake form which takes Patient information like FIRSTNAME, LASTNAME, DATE OF BIRTH, ADDRESS, CITY, and POSTAL CODE.

    When a user enters FIRSTNAME, LASTNAME and DATE OF BIRTH it should fill the rest of the fields (ADDRESS, CITY, POSTAL CODE) if I have a record in my database.

    I am using JAVA with MYSQL and I pull records when a user leaves DATE OF BIRTH textbox.

    I donít know weather I should store everything in a dropdown or I should have a separate form for the matched records from where the user can click the record and fill the rest of the fields.

    Please note I have to achieve all this using JAVASCRIPT.

    Any ideas, suggestions or samples?

    Thanks

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,688
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    You will want to use Ajax techniques to communicate with server-side code to retrieve the appropriate info.

    There is a book called Bulletproof Ajax that has very good instructions on how to achieve this, along with the code from the book which lets you see things in action.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    You will want to use Ajax techniques to communicate with server-side code to retrieve the appropriate info.

    There is a book called Bulletproof Ajax that has very good instructions on how to achieve this, along with the code from the book which lets you see things in action.
    Thank you for your post but I just want to make it clear that I will pull the data using JSP and MYSQL after onchange dateofbirth and I will have the matched records I just want to fill the rest of the fields if user selects a record using JavaScript.

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,688
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by asifakhtar View Post
    Thank you for your post but I just want to make it clear that I will pull the data using JSP and MYSQL after onchange dateofbirth and I will have the matched records I just want to fill the rest of the fields if user selects a record using JavaScript.
    If the client-side script already has the data, then we can help you to do that.

    In order for us to help, we need to know two things.

    1. Where the data is contained.
    2. The HTML fields that you want to fill.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the reply. I figured it out.


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
  •