WordPress photo upload error

I have single file upload feature on my site.

To improve CSS I have added two buttons on my html. one with input type as file and another as button. Input type file is hidden by setting opacity 0 and input type button on top. When I clicked on button I have setup onclick event which triggers the click event of browse button which popup image uploader.

Read More

When I selects image and submit the form I don’t get any details of file in my $_POST.

Why I am doing this, because input type file comes with one text box and a button to its right corner. To open a popup user can single click on button or double click on text box. I want to avoid double clicking.

Any better solution will be appreciated.

Thanks!!

Related posts

Leave a Reply

1 comment

  1. We can click even if an input got opacity 0 !

    In your html:

    <input type="file" style="visibility:hidden;" id="uploadme" />  
    <input type="button" id="clickme" value="Upload Stuff!" />
    

    js:

    $(function(){
        $('#clickme').click(function(){
            $('#uploadme').click();
        });
    });
    

    Now you can stylize your button how you will!