Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HTML
<link rel="stylesheet" type="text/css" href="../testdatetime/jquery.datetimepicker.css"/ >
	<script src="../testdatetime/jquery.js"></script>
	<script src="../testdatetime/jquery.datetimepicker.js"></script>
	
	<label for="datetimepicker">Enter the start date and time of the event</label>
	<br></br>
	<input name="event_start_date_time" id="datetimepicker" type="text" >
	<br></br>
	
	<label for="datetimepicker">Enter the end date and time of the event</label>
	<br></br>
	<input name="event_end_date_time" id="datetimepicker" type="text" >
	<br></br>
	
	
	<script>
	jQuery('#datetimepicker').datetimepicker();
	</script><br></br>




Whats wrong here the first date picker works perfectly but the second doesnt work at all
Posted
Updated 5-Apr-15 12:25pm
v2

1 solution

Both have the same id. Change the id of one of the two datetimepickers.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-Apr-15 22:21pm    
Good catch, a 5.
—SA
Abhinav S 5-Apr-15 22:25pm    
Thank you SA.
Ray-Rae 6-Apr-15 13:49pm    
@Abhinav S , what should I change the id to ?
Abhinav S 6-Apr-15 22:32pm    
Anything. Just make sure both are not same.
Ray-Rae 7-Apr-15 20:12pm    
Thank you @Adhinav S
And I was missing another jquery statement

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900