Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2008
    Posts
    33
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Populating form fields from divs

    There is a situation which feels like a design pattern would be a good fit.

    The application will have 40 or more different forms that users will fill out each with some shared fields and with other unique fields.

    There are going to be two other major divs for form processing purposes: organization, {donor,vendor}

    The organization div will have 3 buttons:
    one for populating the form with the organization's license number and contact information.
    one for populating the form with the organization's license number but using the accounting firms contact information.
    one for populating the form with the organization's license number but using a lawyers contact information.

    The donor or vendor div will also have a populating button which will grab various license numbers and fields and put them into the form.


    So with 40+ forms with such similar requirements, this seems like a great place for a pattern. Also, thinking in terms of minimizing the amount of work when changes occur in the future. Any recommendations on this?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,166
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    "grab"? From whence will the button "grab" those "various licence numbers and fields"???
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    May 2008
    Posts
    33
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    "grab"? From whence will the button "grab" those "various licence numbers and fields"???
    from within fields within a div.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,166
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    <shrug>So yes, you could write a common function to do this. The more the various "contact information" fields are the same in the different cases the more universal the function could be.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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