jQuery Datepicker in PHP code

jQuery Datepicker in PHP code
0

#1

Hello guys. I have a problem in putting jquery datepicker inside my php code. I already connect all the libraries I found related to this but it doesn;t work. It works like a usual text form, but not as a datepicker

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js"></script>

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

<script>

$( function() {
    $( "#datepicker" ).datepicker();
  } );

</script>
<form action="../admin/dcodes_action.php" id="new_code">
		<input id="new_code_textfield" type="text" name="newcode" placeholder="Enter new code">	
		<input id="new_code_submit" type="submit" value="Submit">
		<p><input type="text" name="eenddate" id="datepicker"></p>
</form>;

#2

You only need JQuery and JQuery UI and the JQuery must be put before the JQuery UI. You have 3 different versions of JQuery UI and you have two different versions of JQuery, plus one of the JQuery UIs is before a JQuery.

Just use on of each and make sure JQuery is first.

You need to learn how to use the browser’s console (Ctrl+Shft+J in Chrome) to errors you are getting.


#3

but it is not working either


#4

Repost your latest code after making the changes.


#5
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>




<script>
  $( function() {
    $( "#datepicker" ).datepicker();
  } );
</script>
<form action="../admin/dcodes_action.php" id="new_code">
		<input id="new_code_textfield" type="text" name="newcode" placeholder="Enter new code">	
		<input id="new_code_submit" type="submit" value="Submit">
		<p><input type="text" name="eenddate" id="datepicker"></p>
</form>;

#6

Make sure to use https for the JQuery and not http. See if it works after making the change. It does on my end.


#7

unfortunately the same problem. it;s just as a text form


#8

It’s appearance looks like a text box. Did you try clicking the inside the text box?