Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to show JQuery datepicker on my php page
    text
    copied!<p>I followed the source code on Jquery page to get a datepicker for my php page, but I cant get the calendar out. I think the Jquery is not loading for this page, can anyone tell me why? Thanks you </p> <p>Here is my source code: I have my own designs for class element.</p> <pre><code> &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Admin&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="css/style.css" media="screen" /&gt; &lt;link rel="stylesheet" type="text/css" href="css/navi.css" media="screen" /&gt; &lt;script type="text/javascript" src="js/jquery-1.7.2.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" /&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function(){ $(".box .h_title").not(this).next("ul").hide("normal"); $(".box .h_title").not(this).next("#home").show("normal"); $(".box").children(".h_title").click( function() { $(this).next("ul").slideToggle(); }); }); &lt;/script&gt; &lt;script src="ckeditor/ckeditor.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $( "#datepicker" ).datepicker(); }); &lt;/script&gt; &lt;/head&gt; &lt;script&gt; function validateForm() { var x=document.forms["my_form"]["title"].value; var y=document.forms["my_form"]["author"].value; var z=document.forms["my_form"]["keywords"].value; var type=document.forms["my_form"]["category"].value; if (x=="" || y=="" || z =="" || type=="") { alert("Please fill in the required fields"); return false; } } &lt;/script&gt; &lt;body&gt; &lt;div class="wrap"&gt; &lt;div id="header"&gt; &lt;div id="top"&gt; &lt;div class="left"&gt; &lt;p&gt;Welcome, &lt;strong&gt;&lt;?php echo $_SESSION['login']?&gt; &lt;/strong&gt; [ &lt;a href="logout.php"&gt;logout&lt;/a&gt; ]&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="nav"&gt; &lt;ul&gt; &lt;li class="upp"&gt;&lt;a href="#"&gt;Manage Content&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&amp;#8250; &lt;a href="admin.php"&gt;Admin Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&amp;#8250; &lt;a href="viewPosts.php"&gt;Manage Posts&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&amp;#8250; &lt;a href="changePass.php"&gt;Manage User&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="content"&gt; &lt;div id="sidebar"&gt; &lt;div class="box"&gt; &lt;div class="h_title"&gt;&amp;#8250; Manage content&lt;/div&gt; &lt;ul id="home"&gt; &lt;li class="b1"&gt;&lt;a class="icon view_page" href="admin.php"&gt;Admin Home&lt;/a&gt;&lt;/li&gt; &lt;li class="b2"&gt;&lt;a class="icon report" href="viewPosts.php"&gt;Add Posts&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="box"&gt; &lt;div class="h_title"&gt;&amp;#8250; Category&lt;/div&gt; &lt;ul id="home"&gt; &lt;?php include("includes/connect.php"); $sql = "SELECT post_type, COUNT(*) AS num FROM post WHERE post_status ='New' GROUP BY post_type"; $result = mysql_query($sql); while($Cat_row= mysql_fetch_array($result)){ $type =$Cat_row['post_type']; $number = $Cat_row['num']; ?&gt; &lt;li class="b2"&gt;&lt;a class="icon category" href="postType.php?cat=&lt;?php echo $type?&gt;"&gt;&lt;?php echo $type." (".$number.")"?&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php }?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="box"&gt; &lt;div class="h_title"&gt;&amp;#8250; Archives&lt;/div&gt; &lt;ul id="home"&gt; &lt;?php include("includes/connect.php"); $sql_arc ="SELECT post_type, COUNT(*) AS numb FROM post WHERE post_status='Old' GROUP BY post_type"; $result_arc = mysql_query($sql_arc); while($Arc_row= mysql_fetch_array($result_arc)){ $type_arc =$Arc_row['post_type']; $number_arc = $Arc_row['numb']; ?&gt; &lt;li class="b1"&gt;&lt;a class="icon config" href="postArchive.php?type=&lt;?php echo $type_arc?&gt;"&gt;&lt;?php echo $type_arc." (".$number_arc.")"?&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php }?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="main"&gt; &lt;div class="full_w"&gt; &lt;div class="h_title"&gt;Add new Posts&lt;/div&gt; &lt;form method="post" action="viewPosts.php" name="my_form" enctype="multipart/form-data" onsubmit="return validateForm()"&gt; &lt;div class="element"&gt; &lt;label &gt;Title &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;input type="text" name="title" class="text err" /&gt; &lt;/div&gt; &lt;div class="element"&gt; &lt;label&gt;Author &lt;span class="red"&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/label&gt; &lt;input type="text" name="author" class="text err" /&gt; &lt;/div&gt; &lt;div class="element"&gt; &lt;label&gt;Keywords &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;input type="text" name="keywords" class="text err" /&gt; &lt;/div&gt; &lt;div class="element"&gt; &lt;input type="text" id="datepicker"&gt; &lt;/div&gt; &lt;div class="element"&gt; &lt;label&gt;Category &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;select name="category" class="err"&gt; &lt;option value=""&gt;-- select category&lt;/option&gt; &lt;option value="Class"&gt;Class&lt;/option&gt; &lt;option value="Facilities"&gt;Facilities&lt;/option&gt; &lt;option value="Services"&gt;Services&lt;/option&gt; &lt;option value="Announcement"&gt;Announcement&lt;/option&gt; &lt;option value="Promotions"&gt;Promotions&lt;/option&gt; &lt;option value="News"&gt;News&lt;/option&gt; &lt;option value="Uncategorized"&gt;Uncategorized&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="element"&gt; &lt;label for="content"&gt;Page content &lt;span&gt;(required)&lt;/span&gt;&lt;/label&gt; &lt;textarea id="editor1" name="content" class="textarea" rows="10"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;script&gt; // Replace the &lt;textarea id="editor1"&gt; with a CKEditor // instance, using default configuration. CKEDITOR.replace( 'editor1', { // Load the German interface. language: '' }); &lt;/script&gt; &lt;div class="entry"&gt; &lt;button type="submit" name="submit" class="add"&gt;Save Post&lt;/button&gt; &lt;button class="cancel" type="reset" &gt;Cancel&lt;/button&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="footer"&gt; &lt;div class="left"&gt; &lt;p&gt;NUS Staff Club Admin Panel&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php include("includes/connect.php"); if(isset($_POST['submit'])){ $post_title = $_POST['title']; $post_date = date("Y-m-d"); $post_author = $_POST['author']; $post_keywords = $_POST['keywords']; $post_type = $_POST['category']; $post_content = $_POST['content']; $post_status = 'New'; // $post_image = $_FILES['image']['name']; // $image_temp = $_FILES['image']['tmp_name']; /*if(empty($post_title) || empty($post_author) || empty($post_keywords) || empty($post_type) || empty($post_content) ){ exit(); }*/ // else{ // move_uploaded_file($image_temp,"../image/$post_image"); $insert_query = "insert into post (post_title,post_date,post_author,post_keywords,post_type,post_content,post_status) values ('$post_title','$post_date','$post_author' ,'$post_keywords','$post_type','$post_content','$post_status')"; if(mysql_query($insert_query)){ echo "&lt;script&gt;alert('Post has been pushlished successfully')&lt;/script&gt;"; echo "&lt;script&gt;window.open('admin.php','_self')&lt;/script&gt;"; } else{ echo "&lt;script&gt;alert('failed')&lt;/script&gt;";} // } } ?&gt; &lt;?php }?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload