Saturday 5 September 2015

jQuery Show upload button instead of file upload



<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery Show upload button instead of file upload</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
    $(function () {
        $("#fileupload1").change(function () {
            $("#FileName").html($("#fileupload_Dilog").val().substring($("#fileupload_Dilog").val().lastIndexOf('\\') + 1));
        });
    });
</script>
<style type="text/css">
.button {
background: #333;
color: #fff;
padding: 10px 15px;
border-radius: 5px;
}
.button:hover {
background: #51A8CA;
}
</style>
</head>
<body>
<form id="form1>
<div><br />
<input style="display:none" type="file" id="fileupload_Dilog" />
<input type="button" class="button" id="btnUpload" onclick='$("#fileupload_Dilog").click()' value="Upload"/>
<span id="FileName"></span>
</div>
</form>
</body>
</html>



No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...