JQuery :: Datepicker Passing Parameters On Select/close?
Feb 16, 2011
When datepicker closes the calendar window I'd like to pass both the date and the id of the <input> tag in the code below. The documentation mentions 'this' but no info on how to use it or how to use 'inst'.
When dialog pops up and when I want to select date from datepicker but clicking on input datepicker is under dialog. What option make it to be on top ?
I have this bit of code that works (closes .actions-drop when anything else is clicked): $(".actions-drop").click(function(e) { e.stopPropagation(); }); $(document).click(function() { $(".actions-drop").hide(); }); However, I have a datepicker within .actions-drop and whenever that a date is clicked .actions-drop closes (not what I want). I tried adding 'ui-datepicker' to the first function, but that doesn't seem to work.
There is a website that allows unlimited voting for one of my friend's sons. Someone else has been automating the process because another person received 14,000 votes in about an hour.
So my question is: [url]
How can I pass a parameter at the above site so that it votes for the selected person (example - PJ Howell) without clicking the name and then hitting vote?
At the moment, I have datepicker working on my page, and I really like it. When I tab through my form, and the date field receives the focus, the calendar opens. I pick a date and it closes. but some times I'm tabbing backwards through a form, or tabbing over a date field that already has a date in it, and just want to "tab on by". Datepicker open when the date field receives the focus, but does not close when the date field loses the focus.
I cannot seem to get this code to work properly and I'm wondering if it's a simple error in usage.I have a html page that calls a PHP and refreshes a DIV section every 10 seconds. So far works like a charm...but now I want to add some parameters to pass to this script...
Code:
$(document).ready(function() { $("#DTable").load("response_query.php"); var refreshId = setInterval(function()
[code]....
So I added the ?a=aaa,b=bbb,c=ccc, randval='+Math.random()); to the load section and then in my PHP script got the $_GET values . but nothing seems to get passed so I'm wondering whether I have used or incorrectly passes these parameters to the script.
It's working great but sometimes myTitle and myLink contain the plus character (+). When this happens it's not passed. In the case of the title, it's just a problem of looks but in the case of the link, well, the link won't work without the character.
As an example if the title is: Laptop + Accessories What is passed is: Laptop Accessories
I have little bizarre problem. Working in Java web development we have project that we use plenty of templates from Velocity. Where one template can refresh section of it self and display one or more templates. My problems is that in parent template I have to pop up window with message if in child template and item from group A been moved to group B or vice-versa. How to change on child template can be propagated up to parent?
How can I pass some data into datepicker so that the calender displays the date based on the data provided?I am trying to get data from a database then store it in some variable that datepicker can use to display the date...example code?
I like the looks of the validation engine plugin, but I can't figure out one thing... For a particular form field, I need to use an Ajax service to validate the data. I have to pass the value of the text input, of course, but I also need to pass a couple of other key=value pairs along with it. In the file with the selectors there's the option to add extraData (like extraData="name=eric") but I need to set these parameters based on some dynamic info.Is there a way to pass extra information to the ajax service?
I am passing parameters from one page (actually from a frame within a frameset) to another using Javascript. Typically the code is as follows, taking values from a Form.
This has worked fine in all browsers including IE, Chrome and Firefox version 2.0.0.2.
However, I have now found that it doesn't work with Firefox version 3.6.12.
This is because when retrieving the parameters in the new loaded page, the character ' (quote) has been converted to %27 (percent twenty seven).
I can write code to replace %27 with the quote character. However, this is lengthy and time-consuming (as I need to have cyclic code as the javascript replace command seems to work only on the first occurrence within a string).
There are basically 4 fields in a form, being Name,Company,Email and Phone. I'm trying to use the ONBLUR event, on the email field, to then pass parameters to a JS function, which calls a PHP file, to insert a row into a MySQL db. I saw an example of how to do this, using a hidden field, possibly I need 3 hidden fields to pass the 3 parameters (value of fields) ?. Anyway, here is the code:
Problem: I have two functions that send an AJAX call via an attached .js file (engine.js) and then deal with the response. My problem is this, the function can be called by any number of different triggers and needs to pass the data to a different element depending on which one calls it. These different triggers are produced via a repeating region created by Coldfusion. Each element that can get acted upon by "updateImgCount_response" is named "imgCount[recordID]" where "recordID" is a value inserted by coldfusion. This way each Element has a unique ID. Now I just need to know how to tack the "recordID" value returned as part of "obj" onto the 'imgCount' in document.getElementById() the updateImgCount_response function. Code:
I was reading through a book that talked about unobtrusive javascript, and it gave this example of how to trigger a function instead of using an inline onmouseover event handler.
document.getElementById("RandomElementId").onmouseover=RandomFunction; I thought this would be cool, but I can't seem to find a way to pass parameters to the function this way. I assumed you just use RandomFunction(parameter1,parameter2); but no go.
Is there a different syntax for this, or does this technique forbid using parameters?
How could I pass the information in the text fields to a thank you page after user hits submit using javascript?
I was attempting to use this, but it's slightly different from what I'm trying to do: [URL]
This is filling in the text fields via parameters in the URL. I'm trying to pass what the user filled in to the next thank you page listed out to see what they filled in.
When introducing custom functionality to HTML elements we either use existing attributes to pass configuration parameters (like beetle's fValidate (http://www.peterbailey.net/fValidate/)) or invent our own (like my Tooltips (http://www.vladdy.net/webdesign/ToolTips.html)). While this method is ok for small amount of configuration information, it is not that flexible (you need to edit DTD) and becomes combersome when large amount of configuration parameters is needed.
I figured a more convinient way is to use a CSS like string to pass configuration parameters: <div myextension="parameter1: value1; parameter2-subparameter1: value2.1; parameter2-subparameter2: value2.2"> </div>
Then initialization routine would contain: if(myExtensionParameters = divElement.getAttribute('myExtension')) divElement.myExtension = new myExtensionObject(divElement,myExtensionParameters);
Definition of possible parameters and their values can be done using an array of regular expressions: myExtensionParamDefenitions = new Array(); myExtensionParamDefenitions['choiceparameter'] = /^s*(value1a|value1b|value1c)s*$/; myExtensionParamDefenitions['stringparameter'] = /^s*(w+)s*$/; myExtensionParamDefenitions['integerparameter'] = /^s*(d+)s*$/;
Constructor for the myExtensionObject would containd a parseParameters function: function myExtensionObject(divElement,myExtensionParameters) { this.params=new Array(); parseParameters(this.params,myExtensionParamDefenitions,myExtensionParameters); //Verify parameter initialization, if you like str='' for(e in this.params) str+= e + ': ' + this.params[e] + ' ' alert(str); //Do whatever you have to do... }
Function parseParameters has the following code: function parseParameters(object,definitions,parameters) { paramEntries = parameters.split(''); for(var i=0; i<paramEntries.length; i++) { paramEntry = paramEntries[i].split(':'); if(paramEntry.length == 2) { paramName = paramEntry[0].replace(/^s*([w-]+)s*$/,'$1'); if(definitions[paramName]) { res = definitions[paramName].exec(paramEntry[1]); if(res[1]) object[convertCSSName(paramName)] = res[1]; } } } }
Where convertCSSName function converts CSS type name (background-image) to javascript name (backgroundImage) function convertCSSName(cssName) { sn = cssName.split('-'); rs = sn[0]; for(var i=1; i<sn.length; i++) rs += sn[i].replace(/^(w)(w*)$/,function(str,p1,p2,offset,s){return p1.toUpperCase() + p2;}) return rs; }
As a result you have params array of myExtensionObject object populated with validated entries. Changes and expansion is done by simply editing myExtensionParamDefenitions array.
PS: The functions are coded more for clarity rather than for brevity - I'm certain there are ways to improve the implementation.
I have added an event listener to a LI item in the DOM:
liNode.addEventListener("mouseover", mouseOn, true); The mouseOn function: function mouseOn(e) { // Test for IE or Firefox var e = (!e)?window.event:e; var yPos;
[Code]...
I would like to pass in another parameter to the mouseOn function in addition to the event that is passed in automatically. Is there a way to do this?