Skip to Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
162
Chapter 3
javascript and radio buttons
Getting the beverage and size of the order
Before we gure out how to get and update the status of the two coffee
makers, you need to write the code for getSize() and getBeverage().
Let’s look back at the coffee order form and see what we’re dealing with:
JavaScript
PHP script
HTML form
<form>
<p>Name: <input type=”text” name=”name”
id=”name” /></p>
<h3>Size</h3>
<p>
<input type=”radio” name=”size”
value=”small”
checked=”true”>Small</input>
&nbsp;&nbsp;
<input type=”radio” name=”size”
value=”medium”>Medium</input>
&nbsp;&nbsp;
<input type=”radio” name=”size”
value=”large”>Large</input>
</p>
<h3>Beverage</h3>
<p>
<input type=”radio” name=”beverage”
value=”mocha”
checked=”true”>Mocha</input>
&nbsp;&nbsp;
<input type=”radio” name=”beverage”
value=”latte”>Latte</input>
&nbsp;&nbsp;
<input type=”radio” name=”beverage”
value=”cappucino”>Cappucino</input>
</p>
<p>
Here’s coffee.html.
These three <input>s
are the three options
for the beverage.
Here are
the three
size choices.
But how do we find out what size
and beverage Jim selected?
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

What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content