Forums | Email a Colleague | FAQ

Dr. Website Archives

Dr. Website® Archives 2002

August 22, 2002
    Question:
    Dear Dr. Website: HI! How can I send form results to my email address and yet take the users to a confirmation page at the same time?
    Thank You

    Answer:
    You could use a bit of JavaScript to do it using "document.location" like this:

    <SCRIPT LANGUAGE="JavaScript">
    function doit(){
    document.jump.submit();
    window.location="http://yoursite.com/con
    firmation.html";
    }
    </SCRIPT>

    <FORM METHOD=POST
    ACTION="mailto:you@yoursite.com" NAME="jump"
    ENCTYPE="text/plain">
    <font size="-
    1"><b><i>Enter your name in the field
    below:</i></b></font><br>
    <INPUT Type=text Name="webdev" Value="">
    <P>

    <INPUT TYPE=BUTTON VALUE="Go" onClick="doit(); return false;"> </FORM>

    Thanks

    --Dr.Website

    Question:
    Dear Dr. Website:

    How do I set/change a forms recipient value using a select button. ie. if a user selects say 'yorkshire' form a list field or check box can I get it to change the hidden field 'recipient' value? Regards

    Answer:
    Something like the following would work, using a bit of Javascript:

    <SCRIPT
    LANGUAGE="Javascript"> <!--//
    function getemail(){
    var email = document.myform.email.value;
    document.myform.action="mailto:" +
    email; document.myform.submit();
    }
    //--> </SCRIPT>

    <FORM NAME="myform"
    action=""
    METHOD="post"
    ENCTYPE="text/plain">
    <select name="email">
    <OPTION SELECTED
    value="scott@mine.com">scott
    @mine.com <option
    value="sclark@me.com">sclark@me.com <option value="scott@yours.com">scott@yours.com
    <option value="sclark@his.com">sclark@his.com
    </SELECT>
    <INPUT TYPE="submit"
    onClick="getemail();"> </FORM>
    Thanks,

    --Dr.Website --Dr.Website

    Question:
    Dear Dr. Website:
    I knew I'd need you again one of these days! I would like to enable a user to click on a thumbnail of an image and not view the larger jpeg of that image, but download it to their computer (as happens with a link to a Word doc).

    These are jpegs and so would naturally display in a window rather than automatically download when clicked. How?!

    Thank you!

    Answer:
    I wish I could help you out here, but unfortunately, the only way to get the browser to automatically download jpegs instead of displaying them would be to set the MIME type in your web server to treat them as downloadable files...that wouldn't be prudent, as then all the images in your site would do the same if they happen to be jpegs. Of course, you could always place the jpeg images within a zip (compressed) file, and it would automatically download instead of displaying it.
    Thanks

    --Dr.Website ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ForumsEmail a Colleague · FAQ