Subversion Repositories SmartDukaan

Rev

Rev 8590 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
8578 kshitij.so 1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
5
<style type="text/css">
6
* { font-family: Verdana; font-size: 96%; }
7
label {
8
float: left;
9
    width: 150px;
10
}
11
select {
12
    width: 100px;
13
}
14
</style>
15
<script type="text/javascript">
16
$(function(){	
17
$("#uploadContentFile").live('submit', function(){
18
    var formData = new FormData($(this)[0]);
19
	var name = $('#newsletterName').val();
20
    jQuery.ajax({
21
        url: "/user-image!createNewsletter?newsletterName="+name,
22
        type: 'POST',
23
        data: formData,
24
        async: false,
25
        success: function (data) {
26
            alert("Changes propagated successfully");
27
			$('#uploadContentFile')[0].reset();
28
        },
29
		 error : function() {
30
		 	alert("OOPS!!!Failed to do changes.Try Again.");
31
		 },
32
        cache: false,
33
        contentType: false,
34
        processData: false
35
    });
36
 
37
    return false;
38
});
39
});  
40
</script>
41
</head>
42
<body>
43
<h3>Upload News Letter Images</h3>
44
<div style="display: none;" class="msgSuccess">
45
<p style="font-size: 12px; color: green;">Image Uploaded Sucessfully</p>
46
</div>
47
<div style="display: none;" class="msgError">
48
<p style="font-size: 12px; color: red;">Image Failed to upload</p>
49
</div>
50
<div style="padding-top: 20px;">
51
<label for="newsletterName">NewsLetter Name : </label>
52
<input id="newsletterName" name="newsletterName" type="text"/>
53
<br></br>
54
<form id="uploadContentFile" action="/user-image" enctype="multipart/form-data" method="post">
55
<label for="imagePath">Image Path : </label>
56
<input name="userImage" id="file" type="file" />
57
<br></br>
58
<label for="imageName">Image Name : </label>
59
<input id="imageName" name="imageName" type="text"/>
60
<br></br>
61
<input type="submit" value="Update" name="upload" />
62
</form>
63
</div>
64
</body>