Some confusion here, I think. There is no onChange in perl, nor can there be. Your perl scripts run on the server, in response to requests from browsers. They neither know nor care what is being selected on the page, until the point where you hit the submit button and the selections are passed back to the server.
To do what you want - ie to change the nature of a form so that it submits when a selection is made, rather than when a button is pushed - you need to change the way the browser behaves, not the server. Which makes it a javascript question and explains the rather terse replies you'll find here.
This is the sort of question google excels at, by the way. Any one of the 5,810 pages it returns when you search for 'select box onChange' will have something useful to say.
But since you're here, this is how i would do it:
<select name="choose" onChange="this.form.submit()">
<option value="mumble"> mumble </option>
</select>
Or for a navigation drop-down, which I expect is what you're doing:
<select name="choose" onChange="document.location.href=this.options[th
+is.selectedIndex].value">
<option value="/path/page.html"> mumble </option>
</select>
Which doesn't even need any perl on the server side. I'd better stop there before I get in any more trouble.
|