# Planning an accessible dynamic form with Prototype

**URL:** <https://www.ruby-forum.com/t/planning-an-accessible-dynamic-form-with-prototype/141114>\
**Category:** Rails\
**Created:** [June 22, 2008, 5:22am UTC](https://www.ruby-forum.com/t/planning-an-accessible-dynamic-form-with-prototype/141114 "2008-06-22T05:22:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@ron](https://www.ruby-forum.com/u/ron)\
**Post date:** [June 22, 2008, 5:22am UTC](https://www.ruby-forum.com/t/planning-an-accessible-dynamic-form-with-prototype/141114/1 "2008-06-22T05:22:19Z")

</div>

Hi everyone,

I have a bunch of different data types with some things in common. So  
I’m creating a model to hold all of the fields and creating subclasses/  
using inheritance to delineate the relationship between all of the  
models.

So far so good. I’m finding building the new form a bit more  
challenging…because I have a select list of the different subsets of  
the model. If the user picks one of those options, the form is  
supposed to add the fields specific to the that option to the general  
fields. I’m not sure this is clear…I basically want a select box  
that adds fields to a general form depending on what the user picks.

I’m not sure how to implement this. My first thought is to use  
fieldsets or hidden divs and use toggle to show or hide a given part  
of the form depending on what the user picks. A particular selection  
would just toggle the appropriate, hidden part of the form.

This would be fine with me. The trouble is that if a user has a  
screen reader, the reader will read all of the sections (to the best  
of my knowledge). This leads me to wonder if there is a more  
accessible way to do this. Is there another, AJAXy way I can update  
the form’s fields to reflect the User’s choice?

Thanks!

Ron
