Kay1021 Posted April 3, 2010 Share Posted April 3, 2010 I am using this mootools time picker on my site http://www.consideropen.com/blog/2008/07/mootime-mootools-12-javascript-timepicker/#comment-5594...i already have a date picker...and i have it so once you have chosen the date and click outside the pop up calendar that the information will be sent to the database. I did this by using this bit of code in the javascript file var url = 'page.php?cat_ID=' + this.input.get('id') + '&date=' + this.input.get('value'); var request = new Request({ url:url, method:'POST'//, //onRequest: function() { // alert('making ajax call :: ' + url); //} }).send(); So it would send the variables I needed back to my page.php and there i could insert into the database. Works fine....but now i am attempting to do this with the time picker....this one is a little different set up....but i'm having trouble trying to find the right variables to use this.input.get('value') doesn't work and i can't find the right combination. I was hoping someone might be able to help me. Thanks Link to comment https://forums.phpfreaks.com/topic/197424-timepicker-variables/ Share on other sites More sharing options...
andrewgauger Posted April 3, 2010 Share Posted April 3, 2010 With Javascript "this: references which object is calling the function. So if you call: <input type="text" onBlur="javascript:callFunction(this)"> Your function would be set to accept the this variable: function CallFunction(element) { ajaxTime(this.value); } Should send the contents of the text box to an ajax function. Is this what you wanted to do? Link to comment https://forums.phpfreaks.com/topic/197424-timepicker-variables/#findComment-1036262 Share on other sites More sharing options...
Kay1021 Posted April 4, 2010 Author Share Posted April 4, 2010 It's just in the .js page that i need to find what variable is for the result of the time the user has selected. If I have variable then everything will work with what i have....im just not sure what i am suppose to use. Link to comment https://forums.phpfreaks.com/topic/197424-timepicker-variables/#findComment-1036895 Share on other sites More sharing options...
andrewgauger Posted April 5, 2010 Share Posted April 5, 2010 var newChosenTime = hour + ':' + min + minTwo + amPm; Sounds suspicious. found in: //grabs the current selected time and pushes it into the value property of the mootime input field var chosenTime = function() { //gets time from the timechooser display var hour = $(createMootime).getElement('.display_hour').get('text'); var min = $(createMootime).getElement('.display_min').get('text'); var minTwo = $(createMootime).getElement('.display_mintwo').get('text'); var amPm = $(createMootime).getElement('.display_ampm').get('text'); var newChosenTime = hour + ':' + min + minTwo + amPm; //sets the mootime input field to the time on the timechooser $(timepickerInput).setProperty('value', newChosenTime); Link to comment https://forums.phpfreaks.com/topic/197424-timepicker-variables/#findComment-1036973 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.