I am using a js calendar script that populates a text field with a date. When clicking in the field the calendar shows then i choose a date, calendar closes, the date is now in the field. great it works fine.
I want to make this call from a button. when adding the code to a href, the popup shows but nothing happens when selecting a date. I have tried the following scripts will failure.
*html a href and img tag left out* onclick="if(self.gfPop)gfPop.fPopCalendar(document.this_form.elements['example[]']);return false;"
For each {desired value} in array with index ix Select the {ix}th select box Set the option in the {ix}th select box whose value == {desired value} as selected
I know it's really exceptionally easy, but I suck at jQuery...
I think it looks something like one of the below two lines:
Code: selects[ix].val( {desired value}); OR selects[ix].val( {desired value}).attr( 'selected', true);
but I know the select[ix] syntax is wrong, and I don't know how to reference an item at a specific index from the jquery object returned by jquery.find()
I have 2 select windows and have a function to move items from one select window to another. That was working fine until I had to change the names of each box in order to be able to post the select window as an array in PHP.
I am having quite a bit of trouble getting items out of a json encoded array. I have searched this forum tirelessly and can't find anything except more confusion. I'm simply trying to retrieve data from a mysql db via ajax.
select.php: echo $json_encode_data; output is like so: {
[Code]....
Do you need to use a .json file when using .getJSON? I simply want to print data from my select.php file that has an json encoded array. If there is a more simple way to do this without using json encode
The code works fine. When I call the post, I get the categoryid as a result.Now, I should modify the code above, so I can do:post the ajax call sending the category id. this is done get subcategories for this category, and build the array * json_encode the array and echo * get results back in jQuery ajax call, decode and build the < select > field *The array should be built with each element having a sub-array with id and name, right?
i'm a newbie on jquery i'm studying it with the latest version, and following a book called "Learning Jquery" but iencountered a error, and i don't know what the problem is:
i copied the code from the book like this:$('a[@href^="mailto:"]').addClass('mailto'); to try to change the links which start with "mailto" to the new class "mailto" but there's a error reported: uncaught exception: Syntax error, unrecognized expression: [@href^="mailto:"]
version of Apycom's jQuery menu; you can find itat http://apycom.com/ and it is looking really good.I have uploaded files, and published it on a test site - www.flexin.beUnfortunately, some of the submenus starting from the second that haschildren elements, it adds the item on the top level in InternetExplorer.Does anyone on this list has any experience with this library?
I have a JSON structure in API.When I call the API in my code it returns as the same JSON .I have to print this JSON result as table with pagination in Javascript. The table should be dynamic with previous and next buttons and the table should populate the results according to the JSON and each page should have 20 entries and then the remaining entries should go on the next page and I should be able to go back and forth in the table using previous and next respectively.tell me the exact code of how to start with getting JSON from the API and then write the JSON data in the form of dynamic table with pagination.
I have an ASP.net page where I load a record set server side and upload it into a listbox. I'm trying to do all the movement functionalities of the listbox items client side. Specifically, I'm trying to figure out how to copy selected listbox items from one listbox to another -- on button click. I've searched for a while, but every example that I found moves the actual item into another listbox, I just want to copy the selected item to another listbox.
I have a html file that I want to load, loop through the json data and for each json entry I want to add a new block of the html and insert the json data into the matching div/class of the html. json looks like this:
So for each json entry of name/age, I want to insert that into the html, and then add another row, until all json data has been fetched. After this I want to insert all of this into #box, which is just a divthat should contain that html. Looping like this obviously does not work, since I just keep replacing the same html through the loop.
This code does not working in Mozilla. Works fine in IE. -------------- <input type=text value=100 name=textbox> <script> alert(textbox); </script> -------------- This perhaps, because of Microsoft policy to globalize all tag names. Is there any method for cross-browser fix without using getelementbyid? Is there any method to pass values from outside of <script>, inside? (something like "global" in php functions) Javascript must be kept inside <script> tag.
i'm wondering how i can get a reference to the next td in a row? Do i need to assign all td's an id or something? i could do that failry easily because the table gets generated dynamically via a php function.. i just hink this would be nice that way when i go to delete something (with those infamous checkboxes) i would like the javascript prompt to display what it is that will be deleted..
I am trying to order a laptop from the Dell online shop but everytime I try to press 'continue' after picking the options, I get an error message in the lower left hand corner of the browser. I'm using WIN 98SE with java enabled on my laptop.
I would assume there's a bug in that line. Although there's little I can do about it other than forward it to the Dell folks - my pgming background has me curious as to what's causing this!
I need to do a function in javascript to check or uncheck all checkboxes with the same id. I want this function to work in every form and every page of my site, as I will use the same id ("sel") for all checkboxes in the site. So I need to refer to these by id. Code:
I have a form that appears several times on a page, and would rather not assign IDs. Is there a way to have my validation function focus() a text input without IDs?
i have this code:if (! $_POST["Name"] || ! $_POST["LName"] || ! $_POST["email"] || ! $_POST["phone"]) { $Alert_Message = "Invalid Form"; }i got a js script from another forum here on this site that looks like this, and does work well:print <<<JSOUT <script type="text/javascript"> confirm("Form is INVALID");
[Code]...
exit;i have 4 different messages that i want to choose from to be displayed in the js script, and I want to store the message that i want to use in a PHP variable along the way. the variable is: $Alert_Message . i am trying to do this with my confirm() function in js:confirm($Alert_Message);the code is not registering, so something is obviously wrong. can i reference PHP this way in a js script? if not, how would i go about doing this another way? can i change a js variable along the way in my PHP code instead, and then reference THAT variable when i get to my js script?
I have this JavaScript that is supposed to show random products from my database, and show something different every time you refresh or revisit. But I keep getting an error - on my computer - that says Syntax Error in Line 2.
There is no error on most other computers, and the products show, but another script on the page, an article title scroller, stops - on most computers, but not all. It says "no articles available".
I've tried the script on an asp page and a htm page, all by itself, but it still doesn't work. I tried changing all kinds of settings in my browsers, but nothing helps. I'm on XP, SP2, which I've heard has some problems handling javascripts. I don't know if that's true, but if it is, I know that lots of other people will have the same problem as me when they view the page. Actually, I think it is a good thing, that my computer is pointing out this error. I get the error message in IE6, but in NS8 and FF, I just don't see the products. No error message.
Anyway, here are the first three lines of the script:
<% if TRIM(request.servervariables("http_referer")) = "" then %>
Using spellcheck, I found that referer is spelled wrong, it should be referrer. I don't know if that is right for javascript (or asp?), but correcting it didn't make a difference.
The script is JavaScript on an asp page, and it is called in an htm page.
How does one center text in an alert box? and how do you make the alert box appear in the middle of the screen? I've seen it done, but my alerts have text left justified, and the box is longer than i need.
I found this in one of my old scripts but I can't remember what the -0 was used for. I remember it was a shortcut method but I can't remember for what. Does this ring a bell with anyone?
var Pattern = /px/; var T = paddingArry[0].replace(Pattern, "")-0;
Does the "semicolon insertion" really affect you if you format code as
function x (y) { // ... }
instead of:
function x (y) { // ... }
The jslint page complains about lines ending in ) due to the nebulous idea of "semicolon insertion". I have not reviewed the ECMAScript pdf in great detail to try to pin this pretty-printing issue down. In general, I find that code formatted in the "K&R" style (opening brace on same line as if, while, function) confusing and difficult to read compared with placing curly braces on separate lines.
On another subject, the difference between inner functions defined explicitly versus defined using function expressions seems like a good one for a FAQ. Under what circumstances does it make a real difference whether you use function expression versus function statement versus Function object?