jQuery Dialog of popup?
ik ben een soort van nieuwswebsite aan het maken, maar weet niet of ik het best een popup kan gebruiken of een jQuery dialog?
Ik wil dit gebruiken om de admin te laten inloggen, nieuwsbericht toe te voegen, en nog verschillende kleine formulieren...
Wat is het snelst en meest gebruiksvriendelijke?
Alvast bedankt!
Als je alleen al bedenkt dat veel mensen tegenwoordig popup blockers hebben is de keuze volgens mij snel gemaakt.
jQuery is zowel gebruiksvriendelijk als makkelijk te implementeren. Zoals Erwin al zei, javascript pop-ups worden tegenwoordig bijna altijd geblokkeerd.
Erwin H op 15/08/2012 12:59:26:
Als je alleen al bedenkt dat veel mensen tegenwoordig popup blockers hebben is de keuze volgens mij snel gemaakt.
+1
Dus ook voor formulieren is dit goed te doen?
Ja hoor, ik doe niet anders.
Alleen zit ik wel met het probleem dat jQuery de table niet in de dialoog zet..
De dialoog is dan leeg, maar op de pagina waar de dialoog op staat, staat de table dan wel?
& als ik de table weg doe op lijn 6, dan werkt het wel?
EDIT: Ik heb het opgelost! dit is mijn code nu: klopt dit een beetje?
Code (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
if($_GET['type'] == 'upcomming'){
echo('<h3>Upcomming events in which we will participate:</h3>');
echo('<table width="100%"><tr><th>Start</th><th>End</th><th>Event</th><th>Country</th><th>Category</th><th>Class</th></tr>');
//Get all the upcomming events
$query= "SELECT id , startDate, endDate, event, country, category, class FROM upcomming ORDER BY startDate ASC";
$resultaat = mysql_query($query) or die("An error has occured! ".mysql_error().$query);
while($rij= mysql_fetch_array($resultaat)){
//Converting experation-date to universal date
$startDate = strtotime($rij['startDate']);
$startDate = date('d-M-Y',$startDate);
$endDate = strtotime($rij['endDate']);
$endDate = date('d-M-Y', $endDate);
$exp_date = strtotime($rij['endDate']." +1 day");
$todays_date = date("d-m-Y");
$today = strtotime($todays_date);
if ($exp_date < $today and !isset($expired_event)) {
$expired_event=$rij['id'];
echo('this event is expired :'.$rij['event'].'<br />');
}
echo('<tr><td>'.$startDate.'</td><td> '.$endDate.'</td><td>'.$rij['event'].'</td><td>'.$rij['country'].'</td><td>'.$rij['category'].'</td><td>'.$rij['class'].'</td></tr>');
}
echo('</table>');
if (isset($expired_event)){
$query= "SELECT id, startDate, endDate, event, country, category, class FROM upcomming WHERE id=".$expired_event."";
$resultaat = mysql_query($query) or die("An error has occured! ".mysql_error().$query);
$rij= mysql_fetch_array($resultaat);
$endDate = $rij['endDate'];
$startDate = strtotime($rij['startDate']);
$startDate = date('d-M-Y',$startDate);
$endDate = strtotime($rij['endDate']);
$endDate = date('d-M-Y', $endDate);
echo('<div id="dialog" title="An event has been finished" style="display:none;">');
if(isset($_POST['eventID'])){
if(isset($_POST['sendPlace'])){
}elseif(isset($_POST['deleteEvent'])){
}
echo('</div>');
}else{
echo('<h1>The following event has been expired:</h1>
<table width="100%" align="center">
<tr><td>Started:</td><td> '.$startDate.'</td></tr>
<tr><td>Ended:</td><td> '.$endDate.'</td></tr>
<tr><td>Event:</td><td> '.$rij['event'].'</td></tr>
<tr><td>Country:</td><td> '.$rij['country'].'</td></tr>
<tr><td>Category:</td><td> '.$rij['category'].'</td></tr>
<tr><td>Class:</td><td> '.$rij['class'].'</td></tr>
</table>
<form action="#" method=POST>
<input type="hidden" name="eventID" value='.$rij['id'].' />
<input type="hidden" name="startDate" value='.$rij['startDate'].' />
<input type="hidden" name="endDate" value='.$rij['endDate'].' />
<input type="hidden" name="event" value='.$rij['event'].' />
<input type="hidden" name="country" value='.$rij['country'].' />
<input type="hidden" name="category" value='.$rij['category'].' />
<input type="hidden" name="class" value='.$rij['class'].' />
<p style="text-align: center;">At which place did you ended?</p>
<input type="text" maxlength="3" name="place" />
<div class="buttons">
<button name="sendPlace">Send Place</button>
<button name="deleteEvent">Delete Event</button></div>
</form></div>');
}
}
}
?>
if($_GET['type'] == 'upcomming'){
echo('<h3>Upcomming events in which we will participate:</h3>');
echo('<table width="100%"><tr><th>Start</th><th>End</th><th>Event</th><th>Country</th><th>Category</th><th>Class</th></tr>');
//Get all the upcomming events
$query= "SELECT id , startDate, endDate, event, country, category, class FROM upcomming ORDER BY startDate ASC";
$resultaat = mysql_query($query) or die("An error has occured! ".mysql_error().$query);
while($rij= mysql_fetch_array($resultaat)){
//Converting experation-date to universal date
$startDate = strtotime($rij['startDate']);
$startDate = date('d-M-Y',$startDate);
$endDate = strtotime($rij['endDate']);
$endDate = date('d-M-Y', $endDate);
$exp_date = strtotime($rij['endDate']." +1 day");
$todays_date = date("d-m-Y");
$today = strtotime($todays_date);
if ($exp_date < $today and !isset($expired_event)) {
$expired_event=$rij['id'];
echo('this event is expired :'.$rij['event'].'<br />');
}
echo('<tr><td>'.$startDate.'</td><td> '.$endDate.'</td><td>'.$rij['event'].'</td><td>'.$rij['country'].'</td><td>'.$rij['category'].'</td><td>'.$rij['class'].'</td></tr>');
}
echo('</table>');
if (isset($expired_event)){
$query= "SELECT id, startDate, endDate, event, country, category, class FROM upcomming WHERE id=".$expired_event."";
$resultaat = mysql_query($query) or die("An error has occured! ".mysql_error().$query);
$rij= mysql_fetch_array($resultaat);
$endDate = $rij['endDate'];
$startDate = strtotime($rij['startDate']);
$startDate = date('d-M-Y',$startDate);
$endDate = strtotime($rij['endDate']);
$endDate = date('d-M-Y', $endDate);
echo('<div id="dialog" title="An event has been finished" style="display:none;">');
if(isset($_POST['eventID'])){
if(isset($_POST['sendPlace'])){
}elseif(isset($_POST['deleteEvent'])){
}
echo('</div>');
}else{
echo('<h1>The following event has been expired:</h1>
<table width="100%" align="center">
<tr><td>Started:</td><td> '.$startDate.'</td></tr>
<tr><td>Ended:</td><td> '.$endDate.'</td></tr>
<tr><td>Event:</td><td> '.$rij['event'].'</td></tr>
<tr><td>Country:</td><td> '.$rij['country'].'</td></tr>
<tr><td>Category:</td><td> '.$rij['category'].'</td></tr>
<tr><td>Class:</td><td> '.$rij['class'].'</td></tr>
</table>
<form action="#" method=POST>
<input type="hidden" name="eventID" value='.$rij['id'].' />
<input type="hidden" name="startDate" value='.$rij['startDate'].' />
<input type="hidden" name="endDate" value='.$rij['endDate'].' />
<input type="hidden" name="event" value='.$rij['event'].' />
<input type="hidden" name="country" value='.$rij['country'].' />
<input type="hidden" name="category" value='.$rij['category'].' />
<input type="hidden" name="class" value='.$rij['class'].' />
<p style="text-align: center;">At which place did you ended?</p>
<input type="text" maxlength="3" name="place" />
<div class="buttons">
<button name="sendPlace">Send Place</button>
<button name="deleteEvent">Delete Event</button></div>
</form></div>');
}
}
}
?>
Gewijzigd op 16/08/2012 00:51:58 door Dimitri Van Reeth