locked
Filling fields based on the value of a Choice field? RRS feed

  • Question

  • I hope someone can answer this question, I have built a simple list and I have include a {choice} field that lists 3 different areas in my region, what I would like to do is , If the user picks a certain area, then aI would like certain fields filled in with information specific to that region else, If that person picks a different area, then different information would fill in the fields. thanks for your responses.


    • Edited by Mike Walsh FIN Saturday, June 18, 2011 12:57 AM Original Title was "List" - need I say more ? (Is not enough)
    Saturday, June 18, 2011 12:07 AM

Answers

    • Marked as answer by David HM Monday, June 27, 2011 1:32 AM
    Saturday, June 18, 2011 4:24 AM
  • You could consider doing what SharePoint does natively by:

    1) Create List A that has information for a Region

    2) Create List B with a Lookup to List A.

    You could then customize the display form to display the meshed information from both lists.

    You may even be able to do a web part connection to the Edit Form of List B to a DataView of list a so that when a user selects a region that information is displayed.

    However, if for some reason you just want to store all the information in one list another solution that would not require you to open Visual Studio would be to use jQuery and SPServices (http://spservices.codeplex.com)

    Here's the high level steps:

    1) Create List A that has information for a Region

    2) Create List B with a Lookup to List A as well as the same information fields about the region

    3) Using jQuery, when a user selects the region use SPServices to make a Web Service call to retrieve the information about the region and auto-populate the fields with that information. 

    The SPServices site has many examples on how to use the library, and here is a blog of mine that tells you how to set SharePoint form fields (input,select, and lookup) using jQuery:

    http://sharepointhillbilly.com/archive/2011/04/06/setting-sharepoint-drop-down-lists-w-jquery---20-items.aspx

     

    Good luck,

    Mark

     

     


    The SharePoint Hillbilly
    Fewer Big Words... More Pretty Pictures... http://www.SharePointHillbilly.com
    • Marked as answer by David HM Monday, June 27, 2011 1:32 AM
    Saturday, June 18, 2011 8:51 PM

All replies

    • Marked as answer by David HM Monday, June 27, 2011 1:32 AM
    Saturday, June 18, 2011 4:24 AM
  • You could consider doing what SharePoint does natively by:

    1) Create List A that has information for a Region

    2) Create List B with a Lookup to List A.

    You could then customize the display form to display the meshed information from both lists.

    You may even be able to do a web part connection to the Edit Form of List B to a DataView of list a so that when a user selects a region that information is displayed.

    However, if for some reason you just want to store all the information in one list another solution that would not require you to open Visual Studio would be to use jQuery and SPServices (http://spservices.codeplex.com)

    Here's the high level steps:

    1) Create List A that has information for a Region

    2) Create List B with a Lookup to List A as well as the same information fields about the region

    3) Using jQuery, when a user selects the region use SPServices to make a Web Service call to retrieve the information about the region and auto-populate the fields with that information. 

    The SPServices site has many examples on how to use the library, and here is a blog of mine that tells you how to set SharePoint form fields (input,select, and lookup) using jQuery:

    http://sharepointhillbilly.com/archive/2011/04/06/setting-sharepoint-drop-down-lists-w-jquery---20-items.aspx

     

    Good luck,

    Mark

     

     


    The SharePoint Hillbilly
    Fewer Big Words... More Pretty Pictures... http://www.SharePointHillbilly.com
    • Marked as answer by David HM Monday, June 27, 2011 1:32 AM
    Saturday, June 18, 2011 8:51 PM
  • will this work in WSS 2.0?
    Monday, June 27, 2011 11:23 PM
  • > will this work in WSS 2.0?

    Where in the Title and text of your post did you mention WSS 2.0 ?

    Here the default products are the SP 2007 products. Anything else needs to be stated,

     

    Moderator


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Tuesday, June 28, 2011 8:23 PM