Code:
<form action="#" method="post">
<select onchange="if(this.selectedIndex>0){this.form.action='mailto:someone@some.com?subject='+this.options[this.selectedIndex].value;this.form.submit();}">
<option selected value="">Select</option>
<option value="Homework">Homework</option>
<option value="Assignment">Assignment</option>
</select>
</form>
Substitute your email address for the red place holder. The green value attributes become the subject. You can use 'text' instead of 'value' here:
Code:
subject='+this.options[this.selectedIndex].value;
And the subject will be the text that is shown. This eliminates the need to write everything twice as the value attributes can then be dropped. But, you might want one thing as the selection and another as the subject, in which case retain the value attribute and syntax as is.
This all could be done more simply, without even javascript:
HTML Code:
<form action="mailto:someone@some.com">
<select name="subject">
<option selected value="">Select</option>
<option value="Homework">Homework</option>
<option value="Assignment">Assignment</option>
</select><br>
<input type="submit" value="submit">
</form>
But, Opera will not use the subject (IE and FF were fine with this though, if using OE) and you could end up with the subject as 'Select' in any browser.
I still think a server side solution (as I mentioned before, they are not hard to set up) would be better as, even with no mail client configured, your students could still send the mail. This may be more common than you think what with so many younger folks using hotmail and yahoomail, etc. These type of web based email services do not require (or in most cases allow) one to use a configured email client. As a result, many folks who use them do not bother to configure an email client or, they are using someone else's computer that has an email client setup but, for the owner of the computer, not for them. Computers in libraries typically have no email client configured.
Bookmarks