• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamically displaying checkboxes

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am designing a page wherein there is a select list called product and a checkbox group specific to each product.
I need to do this: whenever a product is selected, a particular set of checkboxed should appear, and when the user selects a different product in the select list, the checkbox group is also changed specific to that product, ie, i need to change the checkboxes dynamically depending on the select list.
Can anyone help me how to do this? (using javascript or any other mechanism)
Thanks,
Priyha.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can show and hide divs tha contain information. If you were to search the form, you should be able to find examples
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An easy method, if you can afford a server round-trip, is to do it on the server via JSP, php, or whatever else you like.
If you want to stay client-side, you could load up all of the poosibilites, each in their own div, and show/hide the div's as appropriate using the display CSS property.
hth,
bear
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great minds do think alike!
bear
 
Priyha Jootu
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot, it works, but one more question. There are like 6 or 7 checkboxes in it and when a item is selected in select list, i am showing only selected checkboxes, because some of them are hidden,the others appear in a random way. Is there a position tag or something like that to always position the visible checkboxes in a ordered way?
Thanks,
Priyha.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you organize the sets of controls in div tags, and then use the display property to have only one set displayed at a time, you have complete control over how the check boxes lay out within the div.
You aren't using the visible property are you? That won't do what you are after.
hth,
bear
 
reply
    Bookmark Topic Watch Topic
  • New Topic