1 / 10

JavaScript 102

JavaScript 102. Nancy Leiby December 11, 2001. JavaScript Notes. Debugging JavaScript in Netscape … put ‘javascript:’ in the URL text box to bring up the Console Netscape is pickier about JavaScript Case sensitive Two ways to specify the form: document. formname . fieldname …

mdavison
Download Presentation

JavaScript 102

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JavaScript 102 Nancy Leiby December 11, 2001 JavaScript 102

  2. JavaScript Notes • Debugging JavaScript in Netscape … put ‘javascript:’ in the URL text box to bring up the Console • Netscape is pickier about JavaScript • Case sensitive • Two ways to specify the form: • document.formname.fieldname… • document.forms[0].fieldname… JavaScript 102

  3. 1onLoad.cfm • Perform an action when the page is loaded using onLoad • <BODY onLoad=“…”> • Set the focus of the cursor to a text box or other field in a form using the JavaScript focus() function JavaScript 102

  4. 2onSubmit.cfm • Perform an action when the form is submitted using onSubmit • Use when validating data: option to not submit the form when bad data found • <FORM … onSubmit=“return …”> • If true is returned, the form is submitted • If false is returned, the form is not submitted JavaScript 102

  5. 3onClick.cfm, 3location.cfm • Perform an action when an object is selected using onClick • Use with button, checkbox, radio, link (image button) • Validation • Change the form action destination using JavaScript document.location= • <INPUT … onClick=“…”> JavaScript 102

  6. 4dynamicfieldnames.cfm • Access a field/object with a dynamically created name • Evaluate("form.fn"&i) • document.formname.elements[“fn"+i]… • Submit a form using the JavaScript submit() function JavaScript 102

  7. 5converttointeger.cfm • In JavaScript multiply by 1to convert a field value from a string (default) to a number • JavaScript append and numbers JavaScript 102

  8. 6relatedlists.cfm • Perform an action when a field is changed using onChange • <SELECT … onChange=“…”> • Convert multi-dimensional arrays in CF into JavaScript arrays using CFWDDX • <CFWDDX action="CFML2JS" … JavaScript 102

  9. 7callback.cfm, 7caller.cfm • Open a page to allow the user to make a selection and insert the selection on the calling page • Call a JavaScript function in the page that opened the current page using opener property. JavaScript 102

  10. Information • Contact me at: • nancy.j.leiby@syntegra.com • My favorite JavaScript book: • JavaScript Bible by Danny Goodman(IDG Books Worldwide, Inc.) JavaScript 102

More Related