forked from kfishster/Decider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewEventForm.php
44 lines (24 loc) · 921 Bytes
/
newEventForm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<h3>Create a new event</h3>
<form class="form-horizontal" id="submitEvent">
<input type="text" id="titleinp" placeholder="Title">
<button type="submit" class="btn">Create</button>
</form>
<script type="text/javascript">
$('#submitEvent').submit(function(event){
event.preventDefault();
var $form = $(this);
title = $('#titleinp').val(),
id = $('#getUserID').attr('userID');
$.post('./scripts/addEvent.php', {title: title, userID: id} , function (data){
$('#eventList').append('<li><a class="openEvent" eventID="' + data + '">' + title + '</a></li>').slideDown();
$('.openEvent').click(function(){
id = $(this).attr('eventID');
$('#eventContent').fadeOut("slow", function(){
$(this).load('eventPage.php',{id:id} ,function(){
$(this).fadeIn("slow");
});
});
});
});
});
</script>