15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1 ✦ Generic HTML Element Objects (Chapter 15)<br />

function sortByYear(type) {<br />

oscars.Sort = (type == “normal”) ? “-Year” : “+Year”<br />

oscars.Reset()<br />

}<br />

function filterInCommon(form) {<br />

var filterExpr1 = form.filter1.options[form.filter1.selectedIndex].value<br />

var filterExpr2 = form.filter2.options[form.filter2.selectedIndex].value<br />

var operator = (form.operator[0].checked) ? “=” : “”<br />

var filterExpr = filterExpr1 + operator + filterExpr2<br />

oscars.Filter = filterExpr<br />

oscars.Reset()<br />

}<br />

<br />

<br />

<br />

Academy Awards 1978-1997<br />

<br />

Sort list by year from newest to<br />

oldest or from oldest to<br />

newest.<br />

Filter listings for records whose<br />

<br />

<br />

Best Picture<br />

Best Director’s Film<br />

Best Actress’s Film<br />

Best Actor’s Film<br />

<br />

is<br />

is not<br />

<br />

<br />

Best Picture<br />

Best Director’s Film<br />

Best Actress’s Film<br />

Best Actor’s Film<br />

<br />

<br />

<br />

<br />

<br />

Year<br />

Film<br />

Director<br />

Actress<br />

Actor<br />

<br />

<br />

<br />

Continued<br />

19<br />

elementObject.dataFld

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!