文件上传

<html>
<head>
<title>wenjianshangchuan</title>
<style type="text/css">
.type-file-box {    position:relative;    width:260px}input {    vertical-align:middle;    margin:0;    padding:0}.type-file-text {    height:22px;    border:1px solid #cdcdcd;    width:180px;}.type-file-button {    background-color:#FFF;    border:1px solid #CDCDCD;    height:24px;    width:70px;}.type-file-file {    position:absolute;    top:0;    right:0;    height:24px;filter:alpha(opacity:0);    opacity: 0;    width:260px}
</style>
<script language="javascript">
$(function () {    var textButton = "<input type='text' name='textfield' id='textfield' class='type-file-text' /> &nbsp;<input type='submit' name='button' id='button' value='浏览...' class='type-file-button' />"    $(textButton).insertBefore("#fileField");    $("#fileField").change(function () {        $("#textfield").val($("#fileField").val());););
</script>
</head>
<body>
<div class="type-file-box"><form action="" method="post" name="form1" id="form1"><input name="fileField" type="file" id="fileField" size="28" /></form></div>
</dody>

posted @ 2013-01-23 15:48  ajiaju  阅读(116)  评论(0编辑  收藏  举报