Showing
2 changed files
with
30 additions
and
1 deletions
This diff is collapsed. Click to expand it.
... | @@ -3,6 +3,32 @@ | ... | @@ -3,6 +3,32 @@ |
3 | <title>ReportingHub - Validate or Upload DDR</title> | 3 | <title>ReportingHub - Validate or Upload DDR</title> |
4 | <link href="lib/rh/rh.css" rel="stylesheet" type="text/css" /> | 4 | <link href="lib/rh/rh.css" rel="stylesheet" type="text/css" /> |
5 | <script type="text/javascript" src="lib/rh/jquery/jquery.js"></script> | 5 | <script type="text/javascript" src="lib/rh/jquery/jquery.js"></script> |
6 | + <script type="text/javascript" src="lib/rh/jquery/jquery.form.js"></script> | ||
7 | + | ||
8 | + <script type="text/javascript"> | ||
9 | + | ||
10 | + $(document).ready(function() { | ||
11 | + $('#theForm').ajaxForm({ | ||
12 | + beforeSubmit: clearOutput, | ||
13 | + success: writeOutput | ||
14 | + }); | ||
15 | + }); | ||
16 | + | ||
17 | + function clearOutput(a, f, o) { | ||
18 | + $('#output').html('Submitting report...'); | ||
19 | + } | ||
20 | + | ||
21 | + function writeOutput(data) { | ||
22 | + var $out = $('#output'); | ||
23 | + if('valid' == data["validation-status"]) { | ||
24 | + $out.html('Report validated OK'); | ||
25 | + } | ||
26 | + else { | ||
27 | + $out.html('Validation failed: ' + data); | ||
28 | + } | ||
29 | + } | ||
30 | + | ||
31 | + </script> | ||
6 | </head> | 32 | </head> |
7 | <body> | 33 | <body> |
8 | <div id="wrapper"> | 34 | <div id="wrapper"> |
... | @@ -15,7 +41,8 @@ | ... | @@ -15,7 +41,8 @@ |
15 | Please select a DDR XML file: | 41 | Please select a DDR XML file: |
16 | </p> | 42 | </p> |
17 | <form enctype="multipart/form-data" id="theForm" method="post"> | 43 | <form enctype="multipart/form-data" id="theForm" method="post"> |
18 | - <div> | 44 | + <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> |
45 | + <div> | ||
19 | <input name="file" type="file" /> | 46 | <input name="file" type="file" /> |
20 | </div> | 47 | </div> |
21 | <br /> | 48 | <br /> |
... | @@ -36,6 +63,8 @@ | ... | @@ -36,6 +63,8 @@ |
36 | <br /> | 63 | <br /> |
37 | <input type="submit" value="Submit" /> | 64 | <input type="submit" value="Submit" /> |
38 | </form> | 65 | </form> |
66 | + <br /> | ||
67 | + <div id="output" /> | ||
39 | </div> | 68 | </div> |
40 | </div> | 69 | </div> |
41 | </body> | 70 | </body> | ... | ... |
-
Please register or login to post a comment