Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2004
    Posts
    25

    Unanswered: Auto Populating Fields In A Form

    Hello.. I am creating a form where account numbers are located in a drop down list, and there are associated text boxes to follow with the account name, region, etc.. What I want to happen is this... Once an account number is selected from the DDL, I want the other fields to "auto-populate" with the associated information from the table without clicking any button. I have been told javascipt and reposting the page are two options. However, with so much data (AROUND 16000 RECORDS), it has been suggested that I repost the page. What do you recommend? And how should i go about doing this? I would greatly appreciate any help!!

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    You can not use the JavaScript to populate data from the table of the database since JavaScript can not work on the server side. In this case, you only can use repost the form.

  3. #3
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Yup.. JavaScript.. you'll need an "onClick" event on the first DDL and subsequent DDLs except the last one. Each "onClick" event will repost the page with the values selected from the DDL.

    I've had a case where I couldn't refresh the entire page, so each DDL was in an IFRAME, and the onClick event posted to the frame of the next DDL, populating it's values, and so on and so forth.
    That which does not kill me postpones the inevitable.

  4. #4
    Join Date
    Jun 2004
    Posts
    25
    So are you suggesting i use JavaScipt or not? I am confused as to how i would go about this? any links or sample codes you can show me? I appreciate your help!

  5. #5
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Quote Originally Posted by gyuan
    You can not use the JavaScript to populate data from the table of the database since JavaScript can not work on the server side. In this case, you only can use repost the form.
    Right... you can use JavaScript to submit a form which refreshes the page and your ASP in the background can populate the DDLs based upon the values that were submit.
    That which does not kill me postpones the inevitable.

  6. #6
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Use JS in on the front end to submit the form to refresh your page, and use ASP in the back end to build the DDLs based upon the values previously selected and submit.
    That which does not kill me postpones the inevitable.

Posting Permissions

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