Skip to content

Instantly share code, notes, and snippets.

@Farmatique
Last active November 15, 2018 18:21
Show Gist options
  • Save Farmatique/6b7258f89e048b7cc26bc2d5ea51699a to your computer and use it in GitHub Desktop.
Save Farmatique/6b7258f89e048b7cc26bc2d5ea51699a to your computer and use it in GitHub Desktop.
Contact form 7 custom upload button
// 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