Enjoy an ad free experience by logging in. Not a member yet?
Register .
01-23-2013, 07:05 PM
PM User |
#1
Regular Coder
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
datetime picker issue
Hi All,
I am using below linked jquery plugin in one of my project and now I have small issue.
In a form when i want to use these plugin it need multiple function for each entry so can I do something like a fixed used for multiple datetime picker feilds with out duplicating it.
Code:
http://trentrichardson.com/examples/timepicker/
function is :
PHP Code:
$( '#slider_example_2' ). datetimepicker ({
showSecond : true ,
timeFormat : 'HH:mm:ss' ,
stepHour : 2 ,
stepMinute : 10 ,
stepSecond : 10
});
Last edited by nani_nisha06; 01-24-2013 at 05:38 AM ..
01-24-2013, 03:08 AM
PM User |
#2
Senior Coder
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
Code:
$("#firstelement,#secondelement,#thirdelement").datetimepicker()
or you can give them all the same class and do
Code:
$(".myclass").datetimepicker()
Users who have thanked DanInMa for this post:
01-24-2013, 05:10 AM
PM User |
#3
Regular Coder
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by
DanInMa
or you can give them all the same class and do
Code:
$(".myclass").datetimepicker()
Danin,
I bit interested to understand this.
On the above example if I change code as below will that be okay?
Code:
$(".slider_example_2").datetimepicker({
showSecond: true,
timeFormat: 'HH:mm:ss',
stepHour: 2,
stepMinute: 10,
stepSecond: 10
});
01-24-2013, 05:15 AM
PM User |
#4
Senior Coder
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
then it will apply to all inputs with a class of "slider_example_2", ( not an id)
i think you need to explain what you want in more detail
01-24-2013, 05:27 AM
PM User |
#5
Regular Coder
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by
DanInMa
then it will apply to all inputs with a class of "slider_example_2", ( not an id)
i think you need to explain what you want in more detail
Danin,
I am using these plugin for timedate picker.
I have a form which need multiple datetime fields...but when I have used above function for only fist field is was able to get the datetime. my requirement is when ever I use the "slider_example_2" in the form as Id that field should enable datetime picker.
I am noob to javascript so I am not able to work on these small fuction that has choke all my functionality.
Appreciate your help.
Thanks,
Nani
01-24-2013, 05:37 AM
PM User |
#6
Regular Coder
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by
DanInMa
then it will apply to all inputs with a class of "slider_example_2", ( not an id)
i think you need to explain what you want in more detail
DanINMa,
declaring as class has solved my problem.
Thanks for your support.
Regards,
Nani
01-24-2013, 02:52 PM
PM User |
#7
Senior Coder
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
Excellent! You should take a look at this page sometime, I dont have them all memorized so I use this page often
http://api.jquery.com/category/selectors/
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 12:29 PM .
Advertisement
Log in to turn off these ads.