Last active
November 15, 2018 18:21
-
-
Save Farmatique/6b7258f89e048b7cc26bc2d5ea51699a to your computer and use it in GitHub Desktop.
Contact form 7 custom upload button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in contact form | |
<div class="btn upload-file-btn"> | |
[file file-967 class:fileuploadfield filetypes:.pdf|.txt|.jpg|.png|.gif|doc|.docx|.mp4|.3gp|.avi|.mov] | |
<input type="button" class="uploadbrowse-btn" value="Upload your file*"> | |
<!-- or use button instead --> | |
<!-- <button class="uploadbrowse-btn" value="Upload your file*">Upload your file*</button> --> | |
</div> | |
//css | |
.fileuploadfield { | |
display:none; | |
} | |
//jQuery | |
$(".uploadbrowse-btn").click(function() { | |
$(this).parent().find('.fileuploadfield').click() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment