|
dpf -> RE: adding a second drop down list (10/24/2005 18:52:52)
|
quote:
You'll need to give the second form a different name and in the js for the second form, change the name in the script on this line: function formHandler(form) to whatever the name of the second form is. that shouldnt be necessary. a function is designed to be used repeatedly - as often as it is "called". in this case, the function formHandler is "called" with this: onChange="javascript:formHandler()"> when the function was defined within the <script> tag, the author defined it as quote:
function formHandler(form) but the use of (form) could have just as easily been x since it merely represents whatever parameter is passed from the call. in other words, it could have (and maybe should have for reasons i will discuss) looked like this: quote:
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin function formHandler(x){ var URL = document.form.site.options[document.x.site.selectedIndex].value; window.location.href = URL; } // End --> </SCRIPT> what happens is that the call passes the form values a a parameter. the x respersents whatever is passed. is thatmaking any sense? the point is that the script function only needs to be defined one time - not for each time it is used.
|
|
|
|