CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   Resolved datetime picker issue (http://www.codingforums.com/showthread.php?t=286308)

nani_nisha06 01-23-2013 07:05 PM

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({
    
showSecondtrue,
    
timeFormat'HH:mm:ss',
    
stepHour2,
    
stepMinute10,
    
stepSecond10
}); 


DanInMa 01-24-2013 03:08 AM

Code:

$("#firstelement,#secondelement,#thirdelement").datetimepicker()
or you can give them all the same class and do

Code:

$(".myclass").datetimepicker()

nani_nisha06 01-24-2013 05:10 AM

Quote:

Originally Posted by DanInMa (Post 1308345)
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
});


DanInMa 01-24-2013 05:15 AM

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

nani_nisha06 01-24-2013 05:27 AM

Quote:

Originally Posted by DanInMa (Post 1308359)
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

nani_nisha06 01-24-2013 05:37 AM

Quote:

Originally Posted by DanInMa (Post 1308359)
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

DanInMa 01-24-2013 02:52 PM

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/


All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.