File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 66 </style>
77
88 <header style="padding:1rem 0; border-bottom: solid lightgray 1px; font-weight:600; font-size:110%;">
9- <span class="dialog-title"></span>
9+ <span class="dialog-title">Drop your comment </span>
1010 </header>
1111
12- <form method="dialog" class ="dialog-form " style="padding-top:1.5rem">
12+ <form id="form" method ="dialog" style="padding-top:1.5rem">
1313 <fieldset>
14- <textarea></textarea>
14+ <textarea name="comment" ></textarea>
1515 </fieldset>
1616 <button class="button">Submit</button>
17- <div style="display:flex; justify-content:flex-end;"></div>
1817 </form>
1918
2019 <script>
3231 dialog.close()
3332 }
3433 })
34+
35+ document.getElementById('form').addEventListener('submit', function(event){
36+ event.preventDefault()
37+ const formdata = new FormData(event.target)
38+
39+ fetch('/reviews/add/{{proposal_pk}}', {
40+ method : 'POST',
41+ body : formdata,
42+ }).then(function (response){
43+ return response.text()
44+ }).then(function (textData){
45+ location.reload()
46+ }).catch(function (error){
47+ alert(error.message)
48+ })
49+ })
3550 </script>
3651</dialog>
You can’t perform that action at this time.
0 commit comments