Results 1 to 8 of 8

Thread: Dynamically FIll in Forms

  1. #1

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141

    Thumbs up Dynamically FIll in Forms

    How can I dynamically fill in text boxes and combo boxes from values entered by a user in other text boxes without loading a new page or clicking a submit button? This would be simple in VB with events, but I don't know enough VBScript or JavaScript. Thanks.

  2. #2

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141

    Thumbs up

    The fields are all on the same form. I.e. There are 2 text boxes and a combo box on a form. The user puts their id number in the first box, and the second box automatically fillis in their name and the combo box selects their country - without the user doing anything more than puting in their id and hiting tab.

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Hmm... you would have to have your alot of your database on the client side to do that most likely.. You would do that by using client side arrays that have foriegn keys to each other as one of their elements.

    Maybe I'm unclear what your asking.. but if you mean can the user login without a round trip to the server, then for security reasons I would say NO. You don't want those parts of the database on the client side.

    In VB you would access the database in an event and populate the other controls. Not as easy on the web because the page is on the client side and the database is on the server side.

    The only other option is to use call the page with a querystring of the user's ID. You can check for the querystring in the top of the page and if found do the necessary database lookups and populate things when the page refreshes.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  4. #4
    rsitogp
    Guest
    Here is the outline: add a webbrowser control to a form.
    Code:
    Private Sub Form_Load()
    WebBrowser1.Navigate "www.thesiteyouneed.com"
    End Sub
    
    Private Sub WebBrowser1_DownloadComplete()
    If WebBrowser1.LocationURL = "www.thesiteyouneed.com" Then
    WebBrowser1.Document.FORMNAMEGOESHERE.TEXTBOXNAMEGOESHERE.Value = "the value you want"
    End Sub

  5. #5

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141

    Thumbs up

    Well I don't mide having all the values when the page first loads, but I only want the client to see certain values based on what the input into the first text box without loading a new page. I thought there may be some JavaScript to do this.

  6. #6
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    The problem is that you would have to have a 2 dimensional array containing a record for each ID and what information each ID has associated with it. Each record will need to have a field that matches to a value in the combo box so that value can be 'selected'. If you have alot of users, this becomes a bit much to send across the net.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  7. #7

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141

    Thumbs up

    That's not really my concern. I just want to be able to fill in fields for the user, if I have the information. To keep them from having to enter the information themselves. There are only a few users. They are filling out a form that will be printed. I guess like an invoice. I don't want them to have to enter data I already have in the database.

  8. #8
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Um.. then why have it on the form at all? Just get it from the database when the form gets submitted and display it on a summary page that has all of the data they entered along with any data that is only from the database.

    I mean, I can give you an example of looping through the recordset to create the dynamic client side script that creates the arrays, but it really sounds like your doing this the hard way.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width