WordPress.org

Support

Support » Plugins and Hacks » Contact Form 7 » Image upload preview

Image upload preview

  • Hi!

    I want to make a form with the contact form 7 plugin and i want to make in the dorm an uploader input to upload images and I want to insert a preview to the end of the form. I have a javascript code for this:

    <script type="text/javascript" src="http://iphonefanatic.hu/wp-content/themes/classipress/js/jquery.min.js"></script><br />
    <script type="text/javascript">
    <!--
    function onFileLoad(e) {
        $('#preview').append('<img class="preview" src="'+e.target.result +'"/>');
    }
    function displayPreview(files) {
        var reader = new FileReader();
        reader.onload = onFileLoad;
        reader.readAsDataURL(files[0]);
    }
    //--></script>

    and the picture appears where the <span id="preview"></span> code

    It’s only working when I put the page’s source to an HTML file.

    Can anyone help me?

    (sorry for my bad english)

  • The topic ‘Image upload preview’ is closed to new replies.
Skip to toolbar