Adding a SELECT
box to the DOM can be tricky, but MooTools gives us the ability to make it look easy. This example will help us solve the common problem of a secondary SELECT
menu upon modification of a first.
In our example, we ready ourselves by knowing the subordinate data to the first SELECT element's options. In a real-world usage, it is likely we would Ajax in the secondary data. If the planned use of the recipe includes Ajaxing in the secondary data, be sure to prepare the server-side script that returns the HTML before beginning.
Use a primary SELECT
drop-down menu to dynamically create a secondary SELECT
drop down:
<form action="javascript:" method="get" id="my_form"> <div id="automobile1" style="background-color:#CDCDCD; margin:5px;"> <table> <tr> <td valign="top">Loan, Lease or Own</td> <td valign="top"> <input name=loanlease[]" type="radio" class="rad2" value="loan"/>...