One Two SIZE NAMEfreeText VALUEThis is free text SUGI Beginning Tutorials onMouseOver onMouseOut document document PDF document - DocSlides

One Two SIZE NAMEfreeText VALUEThis is free text SUGI  Beginning Tutorials  onMouseOver onMouseOut document document PDF document - DocSlides

2014-12-07 174K 174 0 0

Description

theForm documenttheFormfreeText documenttheFormdro Down documenttheFormdro Downo tions documenttheFormdropDownoptions1 documenttheFormfreeTextvalue documenttheFormdro Downo tions value documenttheFormdro Downo tions value SUGI 28 Beginning Tutorials ID: 21650

Embed code:

Download this pdf



DownloadNote - The PPT/PDF document "One Two SIZE NAMEfreeText VALUEThis is f..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentations text content in One Two SIZE NAMEfreeText VALUEThis is free text SUGI Beginning Tutorials onMouseOver onMouseOut document document


Page 1
One Two SIZE=20 NAME='freeText' VALUE='This is free text'> SUGI 28 Beginning Tutorials
Page 2
onMouseOver onMouseOut document document.theForm document.theForm.freeText document.theForm.dro Down document.theForm.dro Down.o tions document.theForm.dropDown.options(1 document.theForm.freeText.value document.theForm.dro Down.o tions .value document.theForm.dro Down.o tions .value SUGI 28 Beginning Tutorials
Page 3
function hiThere() { alert('Hello world!'); } onClick='javascript:hiThere()'> STATE COUNTRY COUNTRY Canada Mexico U.S.A. Select a country SUGI 28 Beginning Tutorials
Page 4
stateList stateList STATE COUNTRY countryList STATE stateList countryList document.theForm.countryList.options[option- number].text document.theForm.countryList.selectedIndex function changeStates() { var selCountry = document.theForm.countryList.selectedIndex ; var country = document.theForm.countryList.options[selCountry] .text ; } COUNTRY COUNTRY stateList if (country == 'Canada') { document.theForm.stateList.options[0].text = 'British Columbia' ; document.theForm.stateList.options[1].text = 'Ontario' ; document.theForm.stateList.options[2].text = 'Quebec' ; document.theForm.stateList.options[3].text = 'Saskatchewan' ; } document.theForm.stateList.options[1] has no properties. options[0] options[1] options[1] Option() if (country == 'Canada') { document.theForm.stateList.options[0] = new Option('British Columbia', null, false, false); document.theForm.stateList.options[1] = new Option('Ontario', null, false, false); document.theForm.stateList.options[2] = new Option('Quebec', null, false, false); document.theForm.stateList.options[3] = new Option('Saskatchewan', null, false, false); }   function changeState() { ... Javascript code... ... } ... FORM elements... ... ... FORM elements... ... SUGI 28 Beginning Tutorials
Page 5
stateList countryList onClick='javascript:changeStates()' > onClick countryList stateList countryList onLoad onLoad='javascript:changeStates()' > onLoad document.theForm.stateList.options.length = 0 ; length options DATA _NULL_ .js COUNTRY STATE countries= new Array('Canada', 'Mexico', 'U.S.A.') ; STATE COUNTRY country1 = new Array('British Columbia', 'Ontario', 'Quebec', 'Saskatchewan') ; country2 = new Array('Baja California Norte', 'Campeche', 'Michoacan', 'Nuevo Leon') ; country3 = new Array('California', 'Colorado', 'Florida', 'Illinois', 'New York', 'North Carolina', 'Texas', 'Washington') ; countries countryList SUGI 28 Beginning Tutorials
Page 6
onLoad function showCountries() { for (var Current=0; Current < countries.length; Current++) { if(Current == 0) {var Selected=true} else {Selected=false} document.theForm.countryList.options[Current] = new Option(countries[Current], null, false, Selected) ; } } Current for() length countryList text stateList changeStates() countryList() Option() true true false null infinity onLoad='javascript: showCountries() ;changeStates( );'> onClick='javascript:changeStates()'> automatic :-) Select a country for() STATE COUNTRY selectedIndex countryList COUNTRY function changeStates() { var selCountry = document.theForm.countryList.selectedIndex ; document.theForm.stateList.options.length = 0; if (selCountry == 0) { for (var Current=0; Current < country1.length; Current++) { document.theForm.stateList.options[Current] = new Option(country1[Current], null, false, false) ; } } ... same for other countries ... } COUNTRY STATE SUGI 28 Beginning Tutorials
Page 7
proc sort data=sashelp.prdsal2 out=countries nodupkey ; by country ; run ; proc sort data=sashelp.prdsal2 out=states nodupkey ; by country state ; run ; filename script ' path-to-your-server \SUGIardef.js' ; data _null_ ; set countries end=last ; file script ; if _n_ eq 1 then put "countries= new Array(" @ ; put "'" country +(-1) "'" @ ; if last then put ");" ; else put "," @ ; run ; data _null_ ; set states ; by country state ; file script mod ; if _n_ eq 1 then countryID=1 ; if first.country then put "country" countryID "= new Array(" @ ; put "'" state +(-1) "'" @ ; if last.country then do ; countryID+1 ; put ");" ; end ; else put "," @ ; retain countryID ; run ; countries= new Array('Canada','Mexico','U.S.A.'); country1 = new Array('British Columbia','Ontario','Quebec','Saskatchewan'); country2 = new Array('Baja California Norte','Campeche','Michoacan','Nuevo Leon'); country3 = new Array('California','Colorado','Florida','Illinois','New York','North Carolina','Texas','Washington'); SUGI 28 Beginning Tutorials
Page 8
function showCountries() { for (var Current=0;Current < countries.length;Current++) { if(Current == 0) {var Selected=true} else {Selected=false} document.theForm.countryList.options[Current] = new Option(countries[Current], null, false, Selected) ; } } function changeStates() { var selCountry = document.theForm.countryList.selectedIndex ; document.theForm.stateList.options.length = 0 ; if (selCountry == 0) { for (var Current=0;Current < country1.length;Current++) { document.theForm.stateList.options[Current] = new Option(country1[Current], null, false, false) ; } } if (selCountry == 1) { for (var Current=0;Current < country2.length;Current++) { document.theForm.stateList.options[Current] = new Option(country2[Current], null, false, false) ; } } if (selCountry == 2) { for (var Current=0;Current < country3.length;Current++) { document.theForm.stateList.options[Current] = new Option(country3[Current], null, false, false) ; } } } automatic :-) Select a country SUGI 28 Beginning Tutorials

About DocSlides
DocSlides allows users to easily upload and share presentations, PDF documents, and images.Share your documents with the world , watch,share and upload any time you want. How can you benefit from using DocSlides? DocSlides consists documents from individuals and organizations on topics ranging from technology and business to travel, health, and education. Find and search for what interests you, and learn from people and more. You can also download DocSlides to read or reference later.