Skip to Main Content
MooTools 1.3 Cookbook
book

MooTools 1.3 Cookbook

by Jay L Johnston
July 2011
Intermediate to advanced content levelIntermediate to advanced
276 pages
5h 11m
English
Packt Publishing
Content preview from MooTools 1.3 Cookbook

Adding a select option using Ajax

Often adding the entire select box is more than is needed to handle the job. Still using our previous recipe, let us just replace the option list of the existing SELECT element instead of adding the entire element.

Getting ready

This recipe is an extension of the previous recipe. Prepare for a simple twist that makes it easier to handle.

How to do it...

Create a FORM with a SELECT element. Use Ajax to call in new OPTION elements and inject them inside the SELECT element:

<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"/>Loan<br ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Jump Start Web Performance

Jump Start Web Performance

Craig Buckler

Publisher Resources

ISBN: 9781849515689Other