Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. Web Forms > Hack #19. Populate an Existing Checkbox Group from the Server

Hack #19. Populate an Existing Checkbox Group from the Server

Dynamically add widgets to an existing group of checkboxes.

This hack deals with another type of adaptive web form, where a group of widgets can change based on the preferences of the user that accesses the web page. In “Submit Checkbox Values to the Server Without a Round Trip” [Hack #17], the code submitted a clicked checkbox value right away to a server program. This hack allows users to add new choices to the same bunch of checkboxes before they choose among those widgets. The web page has a select list including the choices Team or Individual. It shows two groups of checkboxes representing team sports and individual sports. Choosing either Team or Individual from the first pop-up menu or select list expands the existing checkboxes for the selected group by getting new content from a server. Choosing one value from the second pop-up menu restores the original checkboxes for either the Team or Individual list.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint