Re: [jQuery] $("ul li a").hover
to apply it to a specific id, you need to just mention the id in the selector. eg.) $('#testid') in DOM it is important that the ID is unique, if you do have multiple nodes with same ids, which is a violation of HTML, the ID selector will always return the first node with that ID. For a class you can supply the class as well directly. eg.) $('.className') Although for classes you, if you may, specify some hierarchy of elements or classes by separating them using spaces as you mentioned within your example eg) $('.test ul li a') the above selector will select anchor nodes (a), which are children (not necessarily direct children) of li elements which inturn are children of ul eliments which are children of an element with className as test. Thanks & Regards, Dhruva Sagar. On Fri, Jan 15, 2010 at 8:23 AM, J wrote: > Hi, > > Im new to jquery. > > I have a .hover that is applied to all ul li a > $("ul li a").hover > > Question: How can I apply the .hover to a specific class or id? > > I tried something like this but it didn't work for me: > $("#test ul li a").hover > $("test ul li a").hover > > Thanks >
Re: [jQuery] ajax form plugin submit button
Please give us a demo page or code which can help us debug the problem. Thanks & Regards, Dhruva Sagar. On Thu, Jan 7, 2010 at 12:36 PM, Alex wrote: > Hello everyone, > > I have a problem submitting a form tag with submit buttons. many of > the scripts used in that page require the name of these submit buttons > to work correctly. I already read about the serialize function and > submit buttons so tried the form plugin as suggested on the jQuery > page but i can't get this to work. > > On a single site there is no problem using the plugin but the site is > only loaded at the beginning, after that everything works with ajax > requests and the page is never reloaded. The response of nearly all > ajax requests is a new page which is loaded into a draggable div so > that the site works like an OS. My problem is that the form tags that > are contained in these responses aren't submitted by the plugin, they > have their normal function and reload the webpage which is > catastrophical for that layout. > > If you need more information please let me know. > Sorry for my english ;-) >
Re: [jQuery] jQuery Selector Help
I would suggest you to wrap the sections within * into a div and select that div. Thanks & Regards, Dhruva Sagar. On Tue, Dec 22, 2009 at 6:29 PM, Mike Walsh wrote: > Long time listner, first time caller ... > > I am struggling with a selctor and am hopeful someone can help me see > the forest through the trees. I am using a WordPress plugin which > generates the following HTML: > > > 26 > > * > > Christmas Break > > Christmas Break > > * > > http://localhost/?p=104"; style=""> > Futsal Training > > Futsal Training > Time: 1:30 > pm > > Futsal Training at NetSports > > > > > > > I want to strip the asterisk characters ("*") from the HTML. I have > been able to tweak a few things but I am struggling with a selctor > which would allow me to eliminate the asterisk. Any help or > suggestions would be approeciated. I was trying to do this but > innerHTML returns undefined and I am not sure why. > > jQuery('span.even > br').each(function() { >html = this.innerHTML ; >// Some manipulation goes here > jQuery(this).html(html) ; > } > > I am by no means a jQuery guru so I am sure I am missing something > obvious. > > Thanks, > > Mike >
Re: [jQuery] How to get the float direction of an element?
$(this).css('float') Thanks & Regards, Dhruva Sagar. On Fri, Dec 18, 2009 at 3:21 PM, ximo wallas wrote: > Hi there, does anybody knows how to get the float direction of an element? > If I do this: > $(this).attr('style') > I will get all the styles, but I just want to get "right" or "left"... > Can anybody bring me some light? > >
Re: [jQuery] prompt before closing dialog
If you provide your function for the close event you should be able to achieve this. It should return false in case you don't want it to close (in my opinion) Thanks & Regards, Dhruva Sagar. On Thu, Dec 17, 2009 at 3:40 PM, Obi1 wrote: > Hi, i'm having some trouble because i'm using a dialog witch has a > form in it where someone can change info about their hotel. this > dialog also has 2 buttons one to close and the other to save changes. > what i'm trying to accomplish is - when someone made sany change and > tries to close de dialog without saving he will be prompt if he really > wants to leave without saving the changes an the dialog only closes if > person choses 'yes'. > > when closing the window clicking the 'close' button i can accomplish > this, but i wanted it also to work when closing dialog using the "x" > button on the top of the dialog. > > is this possible? >
Re: [jQuery] Re: rotate/loop using jquery
No problem, happens with all of us :) Thanks & Regards, Dhruva Sagar. On Tue, Dec 15, 2009 at 9:39 PM, Glen_H wrote: > yeah, you are right, it appears as though i may have over thought it. > thanks for the response! > > It worked perfectly btw. > > thanks again. > > Glen > > On Dec 15, 11:05 am, Dhruva Sagar wrote: > > There could be many ways to do that. If only you put in a little thought > to > > it :). > > > > This is one of the ways, I am sure this is not the best way, but it > surely > > should meet your demands. > > > > $("#btnTraffic").click(function(){ > > var tr_id = "#trafficLight"; > > if ( $(tr_id).css('background-color') == 'red' ) > > $(tr_id).css("background-color","yellow"); > > else if ( $(tr_id).css('background-color') == 'yellow' ) > > $(tr_id).css('background-color', 'green'); > > else > > $(tr_id).css('background-color', 'red'); > > > > }); > > > > Thanks & Regards, > > Dhruva Sagar. > > > > On Tue, Dec 15, 2009 at 9:25 PM, Glen_H wrote: > > > here is my problem: > > > > > $("#btnTraffic").click(function(){ > > > $("#trafficLight").css("background-color","yellow"); > > > > > }); > > > > > btnTraffic is my button, when I click it, it changes from red to > > > yellow because of the css. > > > > > I want to click it multiple times and have it rotate between red, > > > yellow and green. > > > > > so it starts red, I click it, it turns yellow, then I click it and it > > > turns green, then click again back to red, so on and so forth. anyone > > > have any idea how to make that happen? I can change it once no > > > problem, but I need some type of loop command or something like that. > > > > > Thanks in advance ! > > > > > Glen >
Re: [jQuery] rotate/loop using jquery
There could be many ways to do that. If only you put in a little thought to it :). This is one of the ways, I am sure this is not the best way, but it surely should meet your demands. $("#btnTraffic").click(function(){ var tr_id = "#trafficLight"; if ( $(tr_id).css('background-color') == 'red' ) $(tr_id).css("background-color","yellow"); else if ( $(tr_id).css('background-color') == 'yellow' ) $(tr_id).css('background-color', 'green'); else $(tr_id).css('background-color', 'red'); }); Thanks & Regards, Dhruva Sagar. On Tue, Dec 15, 2009 at 9:25 PM, Glen_H wrote: > here is my problem: > > $("#btnTraffic").click(function(){ > $("#trafficLight").css("background-color","yellow"); > > }); > > btnTraffic is my button, when I click it, it changes from red to > yellow because of the css. > > I want to click it multiple times and have it rotate between red, > yellow and green. > > so it starts red, I click it, it turns yellow, then I click it and it > turns green, then click again back to red, so on and so forth. anyone > have any idea how to make that happen? I can change it once no > problem, but I need some type of loop command or something like that. > > > > Thanks in advance ! > > Glen >
Re: [jQuery] validate australian date
Check out www.datejs.com it's a great library to deal with any kinds of dates Thanks & Regards, Dhruva Sagar. On Tue, Dec 15, 2009 at 8:49 AM, buRn wrote: > Hi does anyone know how to validate australian date? I only have the > normal date validation and want to have the month and day switch > around. > > cheers > bUrn >
Re: [jQuery] How do I write an express to access all radio button elements?
$('input[type=radio]') Thanks & Regards, Dhruva Sagar. On Wed, Dec 9, 2009 at 9:03 PM, laredotorn...@zipmail.com < laredotorn...@zipmail.com> wrote: > Hi, > > I'm trying to access all radio button elements with this expression .. > > var expr = $("element[type='radio']"); > > but the experts among you know this isn't correct. What is the > correct expression? > > Thanks, - Dave >
Re: [jQuery] Re: Opacity for background, but not for the element inside
@Nivanka but that presents a problem that I need to know the child elements of .work before hand. If the DOM is dynamic, it might not be that simple. But I still agree that your approach is better in the given context. Thanks & Regards, Dhruva Sagar. On Mon, Dec 7, 2009 at 9:21 AM, Nivanka wrote: > Rather than setting the opacity from a javascript I prefer if you can > do it in your CSS. > > .work div{ > opacity: 1 !important; > } > > This is better as it doesnt go through the DOM to set the opacity. to > save memory, time of execution etc. > > On Dec 7, 8:26 am, Dhruva Sagar wrote: > > What Greg has mentioned is absolutely true. > > But I think the better / easier approach to solve this issue must be > > something like this : > > > > $(document).ready(function(){ > >$('.work').css('opacity', '0.6').children().css('opacity', '1'); > >//I am actually not very sure about the above code, if that > doesn't > > work this should : > > $('.work').css('opacity', 0.6').children().each(function(){ > > $(this).css('opacity', '1'); }); > > > > } > > > > Thanks & Regards, > > Dhruva Sagar. > > > > On Mon, Dec 7, 2009 at 8:50 AM, Greg Tarnoff > wrote: > > > > > The problem is in the way browsers render opacity. The spec reads that > > > only the element and not children should have the reduced opacity, > > > however none of the browsers have implemented this at last check > > > (maybe safari 4+). > > > > > Your best bet is to apply a background image with the designated > > > opacity as a PNG. This will keep everything at 100% opacity but still > > > resemble the look you are after. > > > > > Another option is to not have .work wrap the other objects and use > > > relative positioning to move them in place. Then you use your current > > > css but it doesn't affect the items you want because they aren't > > > children of .work. > > > On Dec 6, 9:00 pm, Many wrote: > > > > Hey, > > > > > > > > > > DEMO > > > > > > > > > > > > > > I want to set opacity to ".work" , it works fine if i do > $(".work").css > > > > ("opacity","0.6"); but, i don't want the class title and logo have > > > > this opacity, how can i fix it? > > > > > > Thanks for reading!! >
Re: [jQuery] Re: Opacity for background, but not for the element inside
I complete agree with Nivanka :). Didn't think of that :D Thanks & Regards, Dhruva Sagar. On Mon, Dec 7, 2009 at 9:21 AM, Nivanka wrote: > Rather than setting the opacity from a javascript I prefer if you can > do it in your CSS. > > .work div{ > opacity: 1 !important; > } > > This is better as it doesnt go through the DOM to set the opacity. to > save memory, time of execution etc. > > On Dec 7, 8:26 am, Dhruva Sagar wrote: > > What Greg has mentioned is absolutely true. > > But I think the better / easier approach to solve this issue must be > > something like this : > > > > $(document).ready(function(){ > >$('.work').css('opacity', '0.6').children().css('opacity', '1'); > >//I am actually not very sure about the above code, if that > doesn't > > work this should : > > $('.work').css('opacity', 0.6').children().each(function(){ > > $(this).css('opacity', '1'); }); > > > > } > > > > Thanks & Regards, > > Dhruva Sagar. > > > > On Mon, Dec 7, 2009 at 8:50 AM, Greg Tarnoff > wrote: > > > > > The problem is in the way browsers render opacity. The spec reads that > > > only the element and not children should have the reduced opacity, > > > however none of the browsers have implemented this at last check > > > (maybe safari 4+). > > > > > Your best bet is to apply a background image with the designated > > > opacity as a PNG. This will keep everything at 100% opacity but still > > > resemble the look you are after. > > > > > Another option is to not have .work wrap the other objects and use > > > relative positioning to move them in place. Then you use your current > > > css but it doesn't affect the items you want because they aren't > > > children of .work. > > > On Dec 6, 9:00 pm, Many wrote: > > > > Hey, > > > > > > > > > > DEMO > > > > > > > > > > > > > > I want to set opacity to ".work" , it works fine if i do > $(".work").css > > > > ("opacity","0.6"); but, i don't want the class title and logo have > > > > this opacity, how can i fix it? > > > > > > Thanks for reading!! >
Re: [jQuery] Re: Opacity for background, but not for the element inside
What Greg has mentioned is absolutely true. But I think the better / easier approach to solve this issue must be something like this : $(document).ready(function(){ $('.work').css('opacity', '0.6').children().css('opacity', '1'); //I am actually not very sure about the above code, if that doesn't work this should : $('.work').css('opacity', 0.6').children().each(function(){ $(this).css('opacity', '1'); }); } Thanks & Regards, Dhruva Sagar. On Mon, Dec 7, 2009 at 8:50 AM, Greg Tarnoff wrote: > > The problem is in the way browsers render opacity. The spec reads that > only the element and not children should have the reduced opacity, > however none of the browsers have implemented this at last check > (maybe safari 4+). > > Your best bet is to apply a background image with the designated > opacity as a PNG. This will keep everything at 100% opacity but still > resemble the look you are after. > > Another option is to not have .work wrap the other objects and use > relative positioning to move them in place. Then you use your current > css but it doesn't affect the items you want because they aren't > children of .work. > On Dec 6, 9:00 pm, Many wrote: > > Hey, > > > > > > DEMO > > > > > > > > I want to set opacity to ".work" , it works fine if i do $(".work").css > > ("opacity","0.6"); but, i don't want the class title and logo have > > this opacity, how can i fix it? > > > > Thanks for reading!! >
Re: [jQuery] Simple modal plugin - problem with setting focus in modal window
Perhaps you need to call focus() in the callback of fadeIn(150) ? Thanks & Regards, Dhruva Sagar. On Sat, Dec 5, 2009 at 5:53 AM, Igor Benko wrote: > Hi all, > > I have this weird problem I just can't find a way to solve. I'm using > simpleModal plugin as login window and I want to set focus to username > input upon window showing, but can't manage to do that. > This is my code: >$("#prijava_popup").modal( >{opacity: 30, >onOpen: function (dialog) { >dialog.overlay.fadeIn(150, function () { >dialog.container.slideDown(150, function () { >dialog.data.fadeIn(150); >}); >}); > >$('div#simplemodal-container input[name=uime]').focus(); > >}, >onShow: function (dialog) { >$('div#simplemodal-container input[name=uime]').focus(); > }); > >} >}); > > But it doesn't work, I can hide input field but can't set focus to it. > Is this solvable? > > Thank you in advance for your answer, best regards, Igor Benko >
Re: [jQuery] Change opacity for all divs except one
Have all the divs have a class name eg.) thumbs When the user selects his favorite remove this class name from the particular div and apply your opacity logic to $('div.thumbs'), so that way the favorite one would not be changed. Thanks & Regards, Dhruva Sagar. On Sat, Dec 5, 2009 at 3:12 AM, Jared wrote: > Hello all, > > I have a bunch of thumb nails that will be at full opacity when a user > gets to the page. Users will be able to select their favorite. What I > want to have happen is when a user selects their first favorite all of > the there thumbnails will be lowered in opacity then when they select > other favorites the opacity of that thumbnail will be brought to full. > Each thumbnail is in a div. I am at a complete lose on how I can > achieve this. Any help is greatly appreciated. If you need anymore > info just ask. Thanks ins advance! >
Re: [jQuery] Can you limit selector to only search within current element?
Hi, I think the following modification to your code will solve your purpose. $(document).ready(function(){ $("a").click(function(event){ //Loop through each productGroup div $(".productGroup").each(function(i){ //Then for each div I'd like to loop through the uniqueIDs. *$(this).find('div').* each(function(i){ alert($(this).html()); }); }); event.preventDefault(); }); }); Thanks & Regards, Dhruva Sagar. On Sat, Dec 5, 2009 at 3:33 AM, TehNrd wrote: > I am pretty new to jQuery and I've dug through the documentation for a > few hours and I haven't found the answer. I'm curious if you can limit > a selector to only search within a defined div or other html tag. > Below is the code with some notes so it should be pretty easy to > understand but if not let me know and I can clarify. > > > >http://ajax.googleapis.com/ajax/</a> > libs/jquery/1.3.2/jquery.min.js"> > >$(document).ready(function(){ >$("a").click(function(event){ >//Loop through each productGroup div >$(".productGroup").each(function(i){ > >//Then for each div I'd like > to loop through the uniqueIDs. >$("select only the uniqueID > in this productGroup div").each > (function(i){ > > alert($(this).html()); >}); > >}); >event.preventDefault(); >}); >}); > > > > >Go! > > > >1 >2 >3 > > > > > >4 >5 >6 > > > > > > > Thanks for the help, > Jason >
Re: [jQuery] Autcomplete extraParams usage
You can get it in PHP as $_REQUEST['id'] Thanks & Regards, Dhruva Sagar. On Fri, Dec 4, 2009 at 8:06 PM, .. wrote: > > I want to pass some value (other than that i type in text box) when i > am using autcomplete . for that i am using extraParams and passing it > in the below manner > > extraParams: { >id: 1234, > }, > > so how can i get the value in php which i passed as extraParams. > > >
Re: [jQuery] Spellchecker plugin
Cool, appreciate the effort, I will check it out soon and give you my feedback. Thanks & Regards, Dhruva Sagar. On Fri, Dec 4, 2009 at 3:37 PM, Richard W wrote: > Hi jQuery users > > I have pretty much finished my simple spellchecker plugin (barring > additional functionality) and am wanting some testing/feedback/ > criticism/bug reports etc from the jQuery community. > > My initial inspiration for the plugin came from a work responsibility: > to build a spellchecker plugin for a cms we were working on. It was a > "edit-in-place" CMS so the plugin had to work on any block element. We > didn't end up using the spellchecker, so i decided to finish it and > release as open source. > > You can view the project page on google code here: > http://jquery-spellchecker.googlecode.com/ > > A full featued demo can be found here: > http://spellchecker.jquery.badsyntax.co.uk/ > > I've also integrated the plugin into the markitup editor here: > http://spellchecker.jquery.badsyntax.co.uk/markitup.html > > So yea that's about it. It's still very beta at this time, but should > work on most browsers. > > Thank your for your time. > Rich >
Re: [jQuery] An effect like press75's "Massive News" theme
Well it's actually a very simple / basic effect... You could have a div with background image and have some text div over it which is hidden by default and on mouse hover simply show / make that div appear using any of the various jquery-ui effects available...and make it go away (hide it) when the mouse goes out... Thanks & Regards, Dhruva Sagar. On Fri, Dec 4, 2009 at 7:01 AM, Omer wrote: > Greetingz people, > > check this out: http://www.press75.com/demos/massive-news/ > > I like the effect happens when you hover one of the four featured > articles on the top of the page - the way the description appears from > below and everything > > I'm trying to imitate the exact same effect but so far i only managed > to get lost in their endless maze of overlapping CSS styles... > > Does someone know how can i achieve this? can anyone point me to any > article/tutorial/howto that might help? > > Thanks in advance! > > regards > O. >
Re: [jQuery] Automagically link http(s)://, mailto: etc in String
Of course it's possible :). All you need to do is know a little bit of regular expressions & that's pretty much it, you could use simple javascript as well if you like. Thanks & Regards, Dhruva Sagar. On Fri, Dec 4, 2009 at 6:09 AM, Scott Wilcox wrote: > Hello Folks, > > I'm usually pretty good at Googling and finding my own answers to > problems, however this one has left me a little stumped. Is it > possible either using JQuery, a plugin or standard JS to automagically > create links for URI's within a string? > > I'm having a complete block trying to figure this out. > > Thanks for reading, > > Scott. >
Re: [jQuery] error essage: "css is not a function"
Clearly boxes[i] is not a jQuery object. you should try $(boxes[i]).css perhaps Thanks & Regards, Dhruva Sagar. On Thu, Dec 3, 2009 at 1:04 AM, hsfrey wrote: > I'm using the following code: > >var boxes = $('.resizable').get(); // get divs as array >for (var i=0; i{ console.log(boxes[i].id+': left='+boxes[i].css('left')); >} > > I get this error message from Firebug: > boxes[i].css is not a function > [Break on this error] > { safelog($boxes[i].id+': left='+$boxes[i].css('left'));\r > \n > > I have used similar code before, but for an individual item, not an > array. > For instance, This works fine: > > var sel1=$('#'+b1); > var c1x = parseInt(sel1.css('left')); > > Does this simply not work on arrays, or have I made some other error? >
Re: [jQuery] [validate]
Are you using some validate plugin ? If you are doing so, you need to ensure that you execute your code only after the dynamically generated fields have been generated OR you do it everytime your dynamically generated fields are being generated. For ordinary events, there is this 'live' function that jQuery provides which enables you to be able to bind events even to such dynamically generated nodes, but I am not sure if you can make use of that for this validate() call. Thanks & Regards, Dhruva Sagar. On Wed, Dec 2, 2009 at 3:21 PM, 123gotoandplay wrote: > Hi, > > I am trying to validate some dynamic generated input fields, like so > > $("#form1").validate({ >rules: { >$("[name^=eventlink]") : { >required: true, >url: true >} >} > > The input fields have the word eventlink in common, unfort this > doesn't work >
Re: [jQuery] does JQuery have browser bookmarklet development support??
A bookmarklet is simply javascript code. eg.) javascript: alert('Hi!');void(0); You can create a bookmark in your browser and add that code for it. Whenever you click on that bookmarklet, it will then execute that code on the current page and in this particular case alert a message saying 'Hi!'. It's pretty simple, hope you understand. Thanks & Regards, Dhruva Sagar. On Wed, Dec 2, 2009 at 11:33 AM, greghauptmann wrote: > Hi > > I want to development some browser bookmarklets (e.g. for firefox, IE, > safari) but I'm not sure where to start. As an example of what I'm > talking about see: > >* http://www.evernote.com/about/download/web_clipper.php >* http://readitlaterlist.com/bookmarklets/ > > I'm after a way to allow a user pass a browser link (e.g. the page > they are on) through to my web application & see the "bookmarklet" > approach a easier/more basic way to achieve this. They would have to > type in their username/password the first time they use it for the > their authentication to the backend. > > QUESTION: How does one develop these bookmarklets? Does JQuery have > support or supply a template for this? Or just any other pointers on > how people do this? > > Thanks > > >
Re: [jQuery] super easy jquery question
$('#subject').val(""); Thanks & Regards, Dhruva Sagar. On Tue, Dec 1, 2009 at 1:41 PM, mike wrote: > After I have processed a user request from a form submittal, I want to > remove the text from a text field. With JQuery, how do I do > that? The input field has the id of #subject. > > I've tried the following, but to no avail. (I clearly don't > understand jquery). Please help. > > $('#subject').val()=""; > $("#subject").text(''); > $("#subject").text().replace(""); > >
Re: [jQuery] insert date in a table
This is how the code should be in my knowledge : var Date=new Date(); jQuery(document).ready(function(){ $("p").click( function() { $("#time_table").append("<tr><td>" + new Date().toString() + "</td></tr>"); }); }); Thanks & Regards, Dhruva Sagar. On Mon, Nov 23, 2009 at 4:07 PM, Alfredo Alessandrini wrote: > Hi, > > I need to insert the time in a table like this: > > > > >var Date=new Date(); > >jQuery(document).ready(function(){ > >$("p").click( function() { > $("#time_table").append("<tr><td>",document.write(new > Date()),"</td></tr>"); } ); > > }); > > > > > but this don't work... > > > thanks, > > Alfredo >
Re: [jQuery] Problems with writing into input fields
Hi, There could be a lot of reasons behind the inconsistent behaviour. 1.) Are these inputs being added to the DOM dynamically, i.e. at runtime ? If so have you ensured that your updating the values at the right times ? 2.) Are the fields part of the form that you submit ? At all times ? 3.) Are you sure that the variables c_chosen_id & cat_name have been updated appropriately as per your needs before you set the values of the inputs ? Thanks & Regards, Dhruva Sagar. On Wed, Nov 18, 2009 at 9:41 PM, heohni < heidi.anselstet...@consultingteam.de> wrote: > Hi, > > I have a small script which should write me into input hidden fields > some values: > > $('input[name="category_id"]').val(c_chosen_id); > $('input[name="category_name"]').val(cat_name); > > My problem now is, that it seams, the value get's written, because I > can alert it, bit it's not getting written into the source code, > because when I submit my form, I miss these values. > > The strange thing is, that it works sometimes - but not always... > Sometimes I can see the changed values wihin firebug, but sometimes, > the source isn't changing and after submitting the form, I get an > error, that these values hwere missing... > > WHat can I do? >
Re: [jQuery] How to apply blur function to two classes?
The classes should be separated by a ',' (Comma). Please check out the documentation on Selectors, having spaces it looks for the second class within the first class sub-children. That's not what you desire. Try the following code : $(".numAdultsField, .numChildrenField").blur(function() { var id = $(this).attr("id"); var eltPrefix = id.substring(0, id.toLowerCase().indexOf ("num")).replace(":", "\\:"); var numAdultsElt = $('#' + eltPrefix + 'NumAdults'); var numChildrenElt = $('#' + eltPrefix + 'NumChildren'); var total = 0; if (parseInt(jQuery.trim(numAdultsElt.val())) > 0) { total += parseInt(jQuery.trim(numAdultsElt.val())); } // if if (parseInt(jQuery.trim(numChildrenElt.val())) > 0) { total += parseInt(jQuery.trim(numChildrenElt.val())); } // if $('#' + eltPrefix + 'TotalInParty').val(total); }); Thanks & Regards, Dhruva Sagar. On Wed, Nov 18, 2009 at 9:29 PM, laredotorn...@zipmail.com < laredotorn...@zipmail.com> wrote: > Hi, > > I have to apply an onblur function to elements of type > "numAdultsField" or "numChildrenField". How do I do that? This isn't > working ... > >$(".numAdultsField .numChildrenField").blur(function() { >var id = $(this).attr("id"); >var eltPrefix = id.substring(0, id.toLowerCase().indexOf > ("num")).replace(":", "\\:"); >var numAdultsElt = $('#' + eltPrefix + 'NumAdults'); >var numChildrenElt = $('#' + eltPrefix + 'NumChildren'); >var total = 0; >if (parseInt(jQuery.trim(numAdultsElt.val())) > 0) { >total += parseInt(jQuery.trim(numAdultsElt.val())); >} // if >if (parseInt(jQuery.trim(numChildrenElt.val())) > 0) { >total += > parseInt(jQuery.trim(numChildrenElt.val())); >} // if >$('#' + eltPrefix + 'TotalInParty').val(total); >}); > > - Dave >
Re: [jQuery] problem adding event after ajax post
Firstly, your code which you've given has a lot of syntax errors. The selectors are not all enclosed within '' (single quotes). Secondly, in my opinion $('#divld table input') will actually result in an array of inputs (even if length is 1). So you might need to do something like this : $('#divId table input').each(function() { $(this).click(function(){ alert('I am here'); }); }); Thanks & Regards, Dhruva Sagar. On Sun, Nov 15, 2009 at 9:34 AM, nevadaMedicaid wrote: > $.post(''strutseventname', $('form:first').serialize(), > function(data) { > $('#divId').html(data); > alert('am i visible ' + $('#divId table input).length); > $('#divId table input).click(function() { > alert('i am here'); > }); > }, "html"); > > when i execute the function above, the data in divId appears but the > click function doesnt work. i inserted the alert between inserting the > data and setting the click event. it shows that the data is not > visible to jQuery. > > It appears that jQuery cant see the new data until after the > javascript method ends. > > can you help me understand where i am going wrong? > > thanks >
Re: [jQuery] Calling function in jQuery
The function by itself will not be available within other blocks, since the function is in local scope. You should attach the function to the jQuery object instead for later use using the following syntax : (function($) { $.function_name = function test() { alert('in function'); } })(jQuery); Then later in other jQuery blocks (although you will have to ensure that your previously defined block has been already included) you can call your function simply by using $.function_name(); Thanks & Regards, Dhruva Sagar. On Mon, Nov 9, 2009 at 4:27 PM, Murali Krishna B < muralikrishna.vi...@gmail.com> wrote: > Hi all, > > I am creating a function using jQuery in application.js file. > > (function($) { > > function test() { > alert('in function'); > } > })(jQuery); > > When I am trying to call this function from outside (not in this jQuery > block), I am getting an error saying that function is not defined. > I am including this file, also I am calling this function from a jQuery > block. Still I am getting this error. > > How to call that function? > > > > Also, I am facing another issue. I have a form with select option. It will > be populated dynamically after every ajax request. > > In form, I have a select tag with no options. > > > > > After getting a content from ajax, I am preparing all the available > options, and placing that content in select tag. > > var opts = "Murali value='2'>Krishna"; > $("#users").html(opts); > > But it is not showing any options in the select tag. > > Pls help me, > > -- > Thanks & Regards, > > Murali Krishna.B >
Re: [jQuery] i need help
There are a few things I can point out. 1.) You might want to try $('body') instead of $(body) 2.) 'id' is not a CSS attribute, if you wish to change it's value, it should be done like this : $("#hi").attr('id', newid); 3.) [Suggestion] css() accepts a hash : $('#hi').css({ 'top': (y*10), 'left': (x*10) }); Thanks & Regards, Dhruva Sagar. On Sun, Nov 8, 2009 at 3:42 AM, bryre papata wrote: > i am making an ant game, and i have a problem: > > > var x,y; > for(x = 1; x <= 10; x = x + 1){ > images[x] = { > }; > for(y = 1; y <= 10; y = y + 1){ > images[x][y] = { > }; > $(body).append(''); > var newid=x+", "+y; > $("#hi").css('id', newid).css('top',(y*10).css('left', (x*10)) > } > } > > i am pretty sure that there is a problem with the jquery lines, but im not > absolutly sure. > > > The JavaScript revolution has started!!! DOWN WITH FLASH!!! > DOWN WITH FLASH!!! > DOWN WITH FLASH!!! > http://www.chromeexpirements.com >
Re: [jQuery] Why this code don't work
Well I would suggest that you keep adding the generated id's of the inputs & hidden inputs in an array. Write a reset function which then loops through the array and selects them using $() and call remove() for them to remove them from the DOM. Other than that I don't think there is any way specifically that could allow you to identify the inputs created from jquery uniquely. Thanks & Regards, Dhruva Sagar. On Thu, Nov 5, 2009 at 5:56 AM, ReynierPM wrote: > Dhruva Sagar wrote: > >> Great :) >> >> > Hi again Dhruva: > I have one more question regarding this topic. How I can delete all the > newest elements created using the previous jQuery functions? Exists one > method for all or I need to build a custom function and clic as many times > as new elements I added? > Cheers > -- > Saludos > ReynierPM >
Re: [jQuery] Why this code don't work
Great :) Thanks & Regards, Dhruva Sagar. Marie von Ebner-Eschenbach<http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html> - "Even a stopped clock is right twice a day." On Wed, Nov 4, 2009 at 9:09 AM, ReynierPM wrote: > Dhruva Sagar wrote: > >> A minor mistake in the previous mail, please take this into consideration >> and neglect the previous mail : >> >> http://www.w3.org/1999/xhtml"; xml:lang="en"> >> >> http://code.jquery.com/jquery-latest.pack.js"</a>; >> type="text/javascript" language="javascript" charset="utf-8"> >> >> //<![CDATA[ >> $().ready(function(){ >> $('#clicy').click(function(){ >> var id = "word" + $('input[type!=hidden]').length; >> var hid = "hw" + $('input[type=hidden]').length; >> $('input[type=submit]').before('<br/><input type="hidden" name="'+hid+'" >> id="'+hid+'" value="&&"/><label for="'+id+'">&&</label><input type="text" >> name="'+id + '" id="'+id + '" value="" size="30" /><br/>'); >> return false; >> }); >> $('#clico').click(function(){ >> var id = "word" + $('input[type!=hidden]').length; >> var hid = "hw" + $('input[type=hidden]').length; >> $('input[type=submit]').before('<br/><input type="hidden" name="'+hid+'" >> id="'+hid+'" value="||"/><label for="'+id+'">||</label><input type="text" >> name="'+id + '" id="'+id + '" value="" size="30" /><br/>'); >> return false; >> }); >> }); >> //]]> >> >> >> >> >> Texto: >> >> >> >> Adicionar criterio de búsqueda (&&) | > id="clico">Adicionar criterio de búsqueda (||) >> >> >> >> >> Thanks & Regards, >> Dhruva Sagar. >> >> >> Stephen Leacock< >> http://www.brainyquote.com/quotes/authors/s/stephen_leacock.html> >> >> - "I detest life-insurance agents: they always argue that I shall some >> day >> die, which is not so." >> >> On Wed, Nov 4, 2009 at 8:46 AM, Dhruva Sagar >> wrote: >> >> >> > Thanks a lot, I made some improvements to your code because I'm using a > table now but it works perfectly. > > -- > Saludos > ReynierPM >
Re: [jQuery] Why this code don't work
A minor mistake in the previous mail, please take this into consideration and neglect the previous mail : http://www.w3.org/1999/xhtml"; xml:lang="en"> http://code.jquery.com/jquery-latest.pack.js"</a>; type="text/javascript" language="javascript" charset="utf-8"> //<![CDATA[ $().ready(function(){ $('#clicy').click(function(){ var id = "word" + $('input[type!=hidden]').length; var hid = "hw" + $('input[type=hidden]').length; $('input[type=submit]').before('<br/><input type="hidden" name="'+hid+'" id="'+hid+'" value="&&"/><label for="'+id+'">&&</label><input type="text" name="'+id + '" id="'+id + '" value="" size="30" /><br/>'); return false; }); $('#clico').click(function(){ var id = "word" + $('input[type!=hidden]').length; var hid = "hw" + $('input[type=hidden]').length; $('input[type=submit]').before('<br/><input type="hidden" name="'+hid+'" id="'+hid+'" value="||"/><label for="'+id+'">||</label><input type="text" name="'+id + '" id="'+id + '" value="" size="30" /><br/>'); return false; }); }); //]]> Texto: Adicionar criterio de búsqueda (&&) | Adicionar criterio de búsqueda (||) Thanks & Regards, Dhruva Sagar. Stephen Leacock<http://www.brainyquote.com/quotes/authors/s/stephen_leacock.html> - "I detest life-insurance agents: they always argue that I shall some day die, which is not so." On Wed, Nov 4, 2009 at 8:46 AM, Dhruva Sagar wrote: > Hi ReynierPM, > * > * > *The following is the test.html i've written for you, i've tweaked it a > bit to get the right id's & also to solve the 2 problems you listed.* > *Try it and see if it does what you wish to do :* > > http://www.w3.org/1999/xhtml"; xml:lang="en"> > > http://code.jquery.com/jquery-latest.pack.js"</a>; > type="text/javascript" language="javascript" charset="utf-8"> > > //<![CDATA[ > $().ready(function(){ > $('#clicy').click(function(){ > var id = "word" + $('input[type!=hidden]').length; > var hid = "hw" + $('input').length; > $('input[type=submit]').before('<br/><input type="hidden" name="'+hid+'" > id="'+hid+'" value="&&"/><label for="'+id+'">&&</label><input type="text" > name="'+id + '" id="'+id + '" value="" size="30" /><br/>'); > return false; > }); > $('#clico').click(function(){ > var id = "word" + $('input[type!=hidden]').length; > var hid = "hw" + $('input[type=hidden]').length; > $('input[type=submit]').before('<br/><input type="hidden" name="'+hid+'" > id="'+hid+'" value="||"/><label for="'+id+'">||</label><input type="text" > name="'+id + '" id="'+id + '" value="" size="30" /><br/>'); > return false; > }); > }); > //]]> > > > > > Texto: > > > > Adicionar criterio de búsqueda (&&) | href="" id="clico">Adicionar criterio de búsqueda (||) > > > > * > *Thanks & Regards, > Dhruva Sagar. > > > Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> - > "Sports is like a war without the killing." > > On Wed, Nov 4, 2009 at 8:31 AM, ReynierPM wrote: > >> Hi Dhruva: >> I'm trying to build a simple search form. Would be nice if the user can >> add her/his own fields for make the search better. What I mean? If you take >> only one input then the search will be limited to this only field containing >> one or more words. By the contrary if the user could add some fields and >> specify criteria like "&&" or "||" the search will be better. For that >> purpose I made some changes to the code. See below: >> >> >> $().ready(function(){ >> $('#clicy').click(function(){ >> var id = "word" + $('input').length; >> var hid = "hw" + $('input').length; >> $('input:last').after('<br/><label for="'+id+'">&&</label><input >> type="text" name="'+id + '" id="'+id + '" value="" size="30" /> <input >> type="hidden" name="'+hid+'" id="'+hid+'" value="&&"/>'); >> return false; >> }); >> $('#clico').click(function(){ >> var id = "word" + $('input').length; >> var hid = "hw" + $('input').length; >> $('input:last').after('<br/><label for="'+id+'">||</label><input >> type="text" name="'+id + '" id="'+id + '" value="" size="30" /> <input >> type="hidden" name="'+hid+'" id="'+hid+'" value="||"/>'); >> return false; >> }); >> }); >> >> >> >> Texto: >> >> >> >> Adicionar criterio de búsqueda (&&) | > href="#" id="clico">Adicionar criterio de búsqueda (||) >> >> As you notice here when I clic the link#clicy two fields are added: one >> hidden with && as value and another with word+id as id with no value. The >> same happen with the link#clico but the value of hidden field goes to ||. >> This code works fine but two things happen here. >> >> 1) When you click for first time in a link (#clicy or #clico) the field is >> added but I need add a hidden field just behind the input#word. How? >> >> 2) The fields are added just behind the SUBMIT button, how I can add just >> between the first field and the submit button? >> >> Cheers and thanks in advance >> >> -- >> Saludos >> ReynierPM >> > >
Re: [jQuery] Why this code don't work
Hi ReynierPM, * * *The following is the test.html i've written for you, i've tweaked it a bit to get the right id's & also to solve the 2 problems you listed.* *Try it and see if it does what you wish to do :* http://www.w3.org/1999/xhtml"; xml:lang="en"> http://code.jquery.com/jquery-latest.pack.js"</a>; type="text/javascript" language="javascript" charset="utf-8"> //<![CDATA[ $().ready(function(){ $('#clicy').click(function(){ var id = "word" + $('input[type!=hidden]').length; var hid = "hw" + $('input').length; $('input[type=submit]').before('<br/><input type="hidden" name="'+hid+'" id="'+hid+'" value="&&"/><label for="'+id+'">&&</label><input type="text" name="'+id + '" id="'+id + '" value="" size="30" /><br/>'); return false; }); $('#clico').click(function(){ var id = "word" + $('input[type!=hidden]').length; var hid = "hw" + $('input[type=hidden]').length; $('input[type=submit]').before('<br/><input type="hidden" name="'+hid+'" id="'+hid+'" value="||"/><label for="'+id+'">||</label><input type="text" name="'+id + '" id="'+id + '" value="" size="30" /><br/>'); return false; }); }); //]]> Texto: Adicionar criterio de búsqueda (&&) | Adicionar criterio de búsqueda (||) * *Thanks & Regards, Dhruva Sagar. Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> - "Sports is like a war without the killing." On Wed, Nov 4, 2009 at 8:31 AM, ReynierPM wrote: > Hi Dhruva: > I'm trying to build a simple search form. Would be nice if the user can add > her/his own fields for make the search better. What I mean? If you take only > one input then the search will be limited to this only field containing one > or more words. By the contrary if the user could add some fields and specify > criteria like "&&" or "||" the search will be better. For that purpose I > made some changes to the code. See below: > > > $().ready(function(){ > $('#clicy').click(function(){ > var id = "word" + $('input').length; > var hid = "hw" + $('input').length; > $('input:last').after('<br/><label for="'+id+'">&&</label><input > type="text" name="'+id + '" id="'+id + '" value="" size="30" /> <input > type="hidden" name="'+hid+'" id="'+hid+'" value="&&"/>'); > return false; > }); > $('#clico').click(function(){ > var id = "word" + $('input').length; > var hid = "hw" + $('input').length; > $('input:last').after('<br/><label for="'+id+'">||</label><input > type="text" name="'+id + '" id="'+id + '" value="" size="30" /> <input > type="hidden" name="'+hid+'" id="'+hid+'" value="||"/>'); > return false; > }); > }); > > > > Texto: > > > > Adicionar criterio de búsqueda (&&) | href="#" id="clico">Adicionar criterio de búsqueda (||) > > As you notice here when I clic the link#clicy two fields are added: one > hidden with && as value and another with word+id as id with no value. The > same happen with the link#clico but the value of hidden field goes to ||. > This code works fine but two things happen here. > > 1) When you click for first time in a link (#clicy or #clico) the field is > added but I need add a hidden field just behind the input#word. How? > > 2) The fields are added just behind the SUBMIT button, how I can add just > between the first field and the submit button? > > Cheers and thanks in advance > > -- > Saludos > ReynierPM >
Re: [jQuery] Why this code don't work
Well I have made some changes to the test.html to achieve the desired results : http://code.jquery.com/jquery-latest.pack.js"</a>; type="text/javascript" language="javascript" charset="utf-8"> // <![CDATA[ $(document).ready(function() { $('#another').click(function() { var id = "word" + $('input').length $('input:last').after('<label for="' + id + '"></label><input type="text" name="' + id + '" id="' + id + '" value="" size="50" />'); return false; }); }); // ]]> Texto: Adicionar criterio This will achieve what you want. Thanks & Regards, Dhruva Sagar. Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html> - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend." On Tue, Nov 3, 2009 at 9:08 AM, ReynierPM wrote: > Dhruva Sagar wrote: > >> Where have you added the $('#another').click() ? >> Is it even in $(document).ready() or not ? Are you sure that the click >> handler is even being called ? >> >> I have created a test.html and tested what you want, it works perfectly >> for >> me. >> >> >> >> >>http://code.jquery.com/jquery-latest.pack.js"</a>; >> type="text/javascript" language="javascript" charset="utf-8"> >> >> // <![CDATA[ >>$(document).ready(function() { >>$('#another').click(function() { >> $('#word').after('<label for="word2"></label><input >> type="text" name="word2" id="word2" value="" size="50" />'); >>}); >>}); >>// ]]> >> >> >> >>Texto: >> >>Adicionar criterio >> >> >> >> Thanks & Regards, >> Dhruva Sagar. >> >> > Ohh I see my mistake now I forget to write this code inside $().ready() for > that it wont work. Now I have a second question: how I can generate > dinamically the number for element input id? I mean every time I click the > link the id will be incremented in one so will be: word1, word2, wordn > Thanks > -- > Saludos > ReynierPM >
Re: [jQuery] Need help using JQuery selectors
Bracket's don't match in your javascript code. The *if($(caller).css("display") == "none") { *<-- bracket is not closed. Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Tue, Nov 3, 2009 at 8:58 AM, wesley.bunton wrote: > > I am trying to use this jquery slide function that i found online. It's a > very basic slide plugin i suppose, which selects a div using the div's id > tag. I wanted to make my menu hide/reveal multiple divs and therefore I > modified this function that I keep in my .js file to make things work > theoretically. But for some reason I cannot get this to work and I think > that it might be that my selectors are implemented wrong in my js file. > Here > is an example of what I've got which seems to work except for when I try my > modified code: > > $(document).ready(function() { > >$(".fadeNext_home").click(function(){ > >$("#home").fadeSliderToggle() > > return false; > >}) > > }); > > This is the code that works in my js file: > >caller = this > >if($(caller).css("display") == "none"){ > >$(caller).animate({ > >opacity: 1, > >height: 'toggle' > >}, settings.speed, settings.easing); > >}else{ > >$(caller).animate({ > >opacity: 0, > >height: 'toggle' > >}, settings.speed, settings.easing); > >} > > }; > > And this is a modified version with my own selector that does not work. > And > I think it's because of the way that I'm trying to interact with an id tag > that was not passed to the js file: > >if($(caller).css("display") == "none"){ > > > >if($("#home").css("display") != "none"){ > >$("#home").animate({ > >opacity: 0, > >height: 'toggle' > >}, settings.speed, settings.easing); > >} > > > I'm new to jquery (obviously) and would appriciate any help. Thanks so > much! > > thanks, > wes > -- > View this message in context: > http://old.nabble.com/Need-help-using-JQuery-selectors-tp26159956s27240p26159956.html > Sent from the jQuery General Discussion mailing list archive at Nabble.com. > >
Re: [jQuery] Why this code don't work
Where have you added the $('#another').click() ? Is it even in $(document).ready() or not ? Are you sure that the click handler is even being called ? I have created a test.html and tested what you want, it works perfectly for me. http://code.jquery.com/jquery-latest.pack.js"</a>; type="text/javascript" language="javascript" charset="utf-8"> // <![CDATA[ $(document).ready(function() { $('#another').click(function() { $('#word').after('<label for="word2"></label><input type="text" name="word2" id="word2" value="" size="50" />'); }); }); // ]]> Texto: Adicionar criterio Thanks & Regards, Dhruva Sagar. Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Tue, Nov 3, 2009 at 8:53 AM, ReynierPM wrote: > Dhruva Sagar wrote: > >> You should be doing $('#word').after('> type="text" name="word2" id="word2" value="" size="50" />'); >> > > This doesn't work too. I try and get none HTML input added after > input#word. Why? > > -- > Saludos > ReynierPM >
Re: [jQuery] Why this code don't work
You should be doing $('#word').after(''); append() would add your HTML code as a child of that input, hence you will not get the desired results. Thanks & Regards, Dhruva Sagar. Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Tue, Nov 3, 2009 at 8:44 AM, ReynierPM wrote: > Hi every: > I need to add some fields when a user clic a link. For this purpose I build > this piece of code: > > [jQuery/JS Code] > $('#another').click(function(){ > $('#word').append(' name="word2" id="word2" value="" size="50" />'); > }); > > [HTML Code] > Texto: > id="another">Adicionar criterio > > But for some reason when I click the link it doesn't work. Can any help me > to fix this? > -- > Cheers > ReynierPM >
[jQuery] Re: ENTER
The following is an example how to do what you want in jQuery. $('#divid').bind('keydown', function(e) { if (e.which == 13) { $('#secondid').focus(); return false; } }); Thanks & Regards, Dhruva Sagar. Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Wed, Oct 28, 2009 at 6:30 PM, Atilio Camargo Moreira wrote: > > I´m using APEX - Oracle App Express > How can I make when you press Enter, > the focus go to the next item, but without submission? > If Jquery, jscript? >
[jQuery] Re: fadein is not a function?
Np, it happens to everyone, sorry for being a bit harsh :). Thanks & Regards, Dhruva Sagar. Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> - "The trouble with a kitten is that when it grows up, it's always a cat." On Thu, Oct 1, 2009 at 10:09 AM, jessie wrote: > > Yes thank-you... after i posted i had a look. > > I guess looking at this type of *new code* has boggled up my eyes ;-) > > On Oct 1, 2:36 pm, Dhruva Sagar wrote: > > Did you even look at jQuery's site ?the function is fadeIn with a capital > > 'I' > > > > example : $("selector").fadeIn("slow"); > > > > Thanks & Regards, > > Dhruva Sagar. > > > > Joan Crawford< > http://www.brainyquote.com/quotes/authors/j/joan_crawford.html> > > - "I, Joan Crawford, I believe in the dollar. Everything I earn, I > > spend." > > > > On Thu, Oct 1, 2009 at 10:02 AM, jessie wrote: > > > > > Hi > > > > > I'm doing some online tutorials and simple tasks > > > > > I'm getting an error on the function .fadein > > > > > can someone please tell me what is wrong with this code. > > > > > $(function() { // document is ready for load > > > $('a').click(function() { > > >$('.box').fadein(5000); > > > > > }); > > > }); > > > > > Here is the inline style and markup > > > > > > .box { background-color:blue; width:200px; height:200px; } > > > > > > > > > > > Click my link > > > > > Thanks > > > Much appreciated. > > > Jess >
[jQuery] Re: fadein is not a function?
Did you even look at jQuery's site ?the function is fadeIn with a capital 'I' example : $("selector").fadeIn("slow"); Thanks & Regards, Dhruva Sagar. Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html> - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend." On Thu, Oct 1, 2009 at 10:02 AM, jessie wrote: > > Hi > > I'm doing some online tutorials and simple tasks > > I'm getting an error on the function .fadein > > can someone please tell me what is wrong with this code. > > $(function() { // document is ready for load > $('a').click(function() { >$('.box').fadein(5000); > > }); > }); > > > Here is the inline style and markup > > .box { background-color:blue; width:200px; height:200px; } > > > > Click my link > > > Thanks > Much appreciated. > Jess
[jQuery] Re: Loop over all input elements in form
Alertnatively just for your reference these are also some ways to get what you desire : $('form').each(function(){ $(this).children('input').each(function(){ alert(this.name); alert($(this).val()); }) }); Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Wed, Sep 16, 2009 at 3:26 PM, pritisolanki wrote: > > Hi All, > > I tried > > $("form").each(function() { > alert(this.name); > alert($("input").val()); > }); > > in following HTML > > >Form 1 > > > > >Form 2 > > > > >Form 3 > > > > > it only alert "XXX" nothing else !!! any idea about this. My journey > till now is difficult in jquery :-( .Hope to see some answers tomorrow. >
[jQuery] Re: Loop over all input elements in form
This should help : $('form > input').each(function() { alert(this.name); alert($(this).val()); }); Thanks & Regards, Dhruva Sagar. Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Wed, Sep 16, 2009 at 3:26 PM, pritisolanki wrote: > > Hi All, > > I tried > > $("form").each(function() { > alert(this.name); > alert($("input").val()); > }); > > in following HTML > > >Form 1 > > > > >Form 2 > > > > >Form 3 > > > > > it only alert "XXX" nothing else !!! any idea about this. My journey > till now is difficult in jquery :-( .Hope to see some answers tomorrow. >
[jQuery] Re: this.reset() doesn't work
It should be $(this).reset(); But since your using an id in the selector, that will reset only the particular form you want. If you wish to reset all the forms in the page you should do something similar to this : $('form').each(function(){ $(this).reset(); }); You should of course put this piece of code in the document ready function. Thanks & Regards, Dhruva Sagar. Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Wed, Sep 16, 2009 at 1:45 PM, pritisolanki wrote: > > Hi, > > I am trying to reset all the form element but it is not working can > someone suggest the reason. > > www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > http://www.w3.org/1999/xhtml";> > > > jQuery Starterkit > > href="screen.css" /> > > > > > > <!-- > $(document).ready(function() { > > $("#reset").click(function() { > $("form").each(function() { > this.reset(); > }); > }); > > > }); > > //--> > > > jQuery Starterkit > This page contains code to test the examples. Most of it is only > relevant for a example. > > Some link > > > Hehehehe so think you can hide me :-p p> > > > >Form 1 > > > > >Form 2 > > > > >Form 3 > > > > >Reset! > > > >
[jQuery] Re: Jquery document .ready function throwing object expected
Are you sure that the src paths are all correct ? Thanks & Regards, Dhruva Sagar. Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Tue, Sep 15, 2009 at 4:24 PM, Vardhini wrote: > > Thanks for the response..I tried ..both no luck.. > > On Sep 15, 3:43 pm, Steven Yang wrote: > > i am not sure what /jquery-1.3.2-vsdoc.jsis for but try putting it behind > > jquery-1.3.2.js > > > > and also putting ui.core.js before ui.datepicker.js > > > > On Tue, Sep 15, 2009 at 6:31 PM, Vardhini wrote: > > > > > Hi, > > > > > I'm getting Javascript error "object expected"on PageLoad at the > > > following line: > > > > > $(document).ready(function() > > > > > I found that alert(typeof $); is returing undefined. > > > > > Below is the code snippet: > > > > > > > > > > language ="javascript"> > > > > > > > > > > > > > > language ="javascript"> > > > > >
[jQuery] Re: Autocomplete plugin - customization
Hi, Which autocomplete plugin are you using ? Thanks & Regards, Dhruva Sagar. Mike Ditka <http://www.brainyquote.com/quotes/authors/m/mike_ditka.html> - "If God had wanted man to play soccer, he wouldn't have given us arms." On Mon, Sep 14, 2009 at 1:57 PM, Althalos wrote: > > Hi > I'm trying to make a custom hack to the autocomplete plugin. I want it > so that when you select a suggestion I can separate the data in that > suggestion and insert parts of it into four different elements. > > I'll use split to get the data into an array and then use the Val > function to set the values of the elements, but what is the easiest > way to customize theplugon like this? Can I do this wihout editing the > plugn itself?
[jQuery] Re: Why would this code cause this error in IE?
You should use the keyword 'var' before each variable. Thanks & Regards, Dhruva Sagar. Charles de Gaulle<http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html> - "The better I get to know men, the more I find myself loving dogs." On Sat, Sep 12, 2009 at 3:33 PM, Rick Faircloth wrote: > Code: > > > >$(document).ready(function() { > > > > streetNumber = 'valid'; > > streetName = 'valid'; > > city = 'valid'; > > state= 'valid'; > > bedrooms = 'valid'; > > fullBaths= 'valid'; > > rent = 'valid'; > > securityDeposit = 'valid'; > > > >}); > > > > Error: > > > > “Object doesn’t support this property or method” > > > > This doesn’t cause an error in FF. > > > > Thoughts? > > > > Thanks, > > > > Rick > > > > * > --- > * > > *"Those who hammer their guns into plows will plow for those who do not." > - Thomas Jefferson* > > >
[jQuery] Re: Color Animations Cookie
Use the jquery.cookie plugin to save it as a parameter in cookie and onload / document.ready check the cookie if its set, if set use the configuration otherwise use default. Thanks & Regards, Dhruva Sagar. Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Mon, Aug 31, 2009 at 6:41 PM, Michael wrote: > > How can I get the following code: > > $(document).ready(function(){ >$("#go").click(function(){ > $(".block").animate( { backgroundColor: 'red' }, 1000); > $(".block2").animate( { backgroundColor: 'green' }, 1000); > }); > }); > > From: > http://docs.jquery.com/Release:jQuery_1.2/Effects#Color_Animations > > To register a cookie so next time I visit the elements on the page are > set to the color set above?.
[jQuery] Re: $.each cannot iterator my array
Can you give some sample code I could test or somethign ?? Thanks & Regards, Dhruva Sagar. Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html> - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend." On Fri, Aug 28, 2009 at 4:07 PM, Xi Shen wrote: > > but my program want to iterator the outer array first to find out how > many arrays in the myArray variable. > > > On Fri, Aug 28, 2009 at 5:33 PM, Dhruva Sagar > wrote: > > You have initiallized myArray['somestring'] = new Array(); > > should you be doing $.each(myArray['something'], function() {...}); ? > > Thanks & Regards, > > Dhruva Sagar. > > > > > > Samuel Goldwyn - "I'm willing to admit that I may not always be right, > but > > I am never wrong." > > > > On Fri, Aug 28, 2009 at 1:19 PM, davidshe...@googlemail.com > > wrote: > >> > >> Hi, > >> > >> i have an array initialized like > >> var myArr = new Array(); > >> > >> later I use > >> > >> myArray['somestring'] = new Array(); > >> myArray['somestring'].push(mydata); > >> > >> to create and new array inside of it, and populate my data by pushing. > >> Then I want to use the jQuery.each(...) to iterator over it, like this > >> > >> $.each(myArray, function(){ > >> alert(this); > >> }); > >> > >> But I found the jQuery does not event enter the loop. What's wrong > >> with my array? > > > > > > > > -- > Best Regards, > David Shen > > http://twitter.com/davidshen84 >
[jQuery] Re: $.each cannot iterator my array
You have initiallized myArray['somestring'] = new Array();should you be doing $.each(myArray['something'], function() {...}); ? Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Fri, Aug 28, 2009 at 1:19 PM, davidshe...@googlemail.com < davidshe...@googlemail.com> wrote: > > Hi, > > i have an array initialized like > var myArr = new Array(); > > later I use > > myArray['somestring'] = new Array(); > myArray['somestring'].push(mydata); > > to create and new array inside of it, and populate my data by pushing. > Then I want to use the jQuery.each(...) to iterator over it, like this > > $.each(myArray, function(){ > alert(this); > }); > > But I found the jQuery does not event enter the loop. What's wrong > with my array? >
[jQuery] Re: Date Text Entry Plugin?
I am not sure if a plugin already exists for what you want to achieve but I will suggest you to have a look at http://www.datejs.com/ for a very neat Date javascript library that I always find useful. It's Date parser is also very cool and powerful, I am sure you can build exactly what you want using this along with jQuery. Thanks & Regards, Dhruva Sagar. Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Fri, Aug 28, 2009 at 9:07 AM, Grant McLean wrote: > uery plugin for date entry. I *don't* want a date
[jQuery] Re: how to pass php variable with load?
I can suggest a few things - I think you should try to URL Encode the url - I think you should try doing event.dragDiv.title.toString() [just in case] Also to note, you don't need the +"" in the end. Thanks & Regards, Dhruva Sagar. On Tue, 2009-08-25 at 07:12 -0700, Enoch wrote: > I am trying to load a php page into DIV B when DIV A is dropped on it. > > My question is: > how do I pass a variable with my jquery load. > > this is what I have: > > .bind( "drop", function( event ){ > $( this ).load("somefile.php?rec="+event.dragDiv.title+""); > } > > everything works fine when I remove the +event.dragDiv.title+"" <>
[jQuery] Re: Problem with Ajax Cross-Domain
LOL! I never saw that Thanks & Regards, Dhruva Sagar. Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> - "The trouble with a kitten is that when it grows up, it's always a cat." On Tue, Aug 25, 2009 at 3:51 PM, Liam Byrne wrote: > > Shouldn't it be > > http://localhost ? > > i.e. http[slash][slash]localhost > > L > > Alexander Cabezas wrote: > >> Hi. >> >> When i try to make an ajax request like: >> $.get( "http:localhost:3001/account/create.json", SignUp.onComplete ); >> >> I get the following error in the firebug ( Net ): >> OPTIONS - 405 Method Not Allowed >> >> Is it related to cross-domain request?. >> >> >> >> No virus found in this incoming message. >> Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: >> 270.13.66/2325 - Release Date: 08/25/09 06:08:00 >> >> >> > >
[jQuery] Re: AJAX and ampersand
Your right, its my mistake, I realized only after I saw Liam Potter's mail.You need to url encode it just as he said or replace it with %26, again just as Liam Potter said. Thanks & Regards, Dhruva Sagar. Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html> - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend." On Tue, Aug 25, 2009 at 3:47 PM, Julijan Andjelic < julijan.andje...@gmail.com> wrote: > > It will again split up the data at & since & also contains the > ampersand... > In that case I would get: > This is some text > amp;blah blah > > On Aug 25, 12:13 pm, Dhruva Sagar wrote: > > Perhaps you should use & instead of a plain &.You can always replace > it > > back with & after you have got the data if you really need. > > > > Thanks & Regards, > > Dhruva Sagar. > > > > Samuel Goldwyn< > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> > > - "I'm willing to admit that I may not always be right, but I am never > > wrong." > > > > On Tue, Aug 25, 2009 at 3:42 PM, Julijan Andjelic < > > > > julijan.andje...@gmail.com> wrote: > > > > > Is there any was to prevent ampersand from splitting up the passed > > > data? > > > > > For example if my data looks like: > > > > > "This is some text&blah blah" > > > > > If I pass it as data it will get split up at "&": > > > > > This is some text > > > blah blah > > > > > Any solutions? >
[jQuery] Re: AJAX and ampersand
Perhaps you should use & instead of a plain &.You can always replace it back with & after you have got the data if you really need. Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Tue, Aug 25, 2009 at 3:42 PM, Julijan Andjelic < julijan.andje...@gmail.com> wrote: > > Is there any was to prevent ampersand from splitting up the passed > data? > > For example if my data looks like: > > > "This is some text&blah blah" > > If I pass it as data it will get split up at "&": > > This is some text > blah blah > > Any solutions?
[jQuery] Re: Getting XML info problem
In your code, did you try and do an alert(xml) inside the success handler function (xml) to see if its getting the right content? Thanks & Regards, Dhruva Sagar. Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Tue, Aug 25, 2009 at 3:21 PM, ximo wallas wrote: > I find it really sad that jquery doesn't have a oficial forum out there... > My question is posted in this one, I can't post it here cause the HTML > inside will blow the e-mail: > http://www.jqueryhelp.com/viewtopic.php?t=3616 > Can somebody help me with this, I'm really stuck... > >
[jQuery] Re: Problem with Ajax Cross-Domain
Michael, >From his last statement / question , it seems to me that he is making the ajax request from a different server than the application itself. Hence I don't think he can use the relative URL that you're suggesting. Now coming to the error, I am not sorry but I don't have a very good idea about the error, haven't seen it before, but I think I would really like to know myself! Thanks & Regards, Dhruva Sagar. Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> - "Sports is like a war without the killing." On Tue, Aug 25, 2009 at 7:09 AM, Michael Geary wrote: > > What happens if you take your URL: > > http:localhost:3001/account/create.json > > and paste it into the address bar in Firefox and then hit Enter? > > Do you see it add something that was missing? :-) > > BTW, I assume your app is running on localhost:3001, is that right? I'd > suggest using a relative URL instead, e.g.: > > /account/create.json > > That way you won't have to change your code if you move your app to a > different server. > > -Mike > > > From: Alexander Cabezas > > > > Hi. > > > > When i try to make an ajax request like: > > $.get( "http:localhost:3001/account/create.json", SignUp.onComplete ); > > > > I get the following error in the firebug ( Net ): > > OPTIONS - 405 Method Not Allowed > > > > Is it related to cross-domain request?. > >
[jQuery] Re: How to move tab from left to right?
On the tab click event, remove the tab and append(to the end) it to the tabs holder div. Thanks & Regards, Dhruva Sagar. Marie von Ebner-Eschenbach<http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html> - "Even a stopped clock is right twice a day." On Sun, Aug 23, 2009 at 12:15 PM, jan.zitniak wrote: > > Hello. > > Please, can you give me advance how to move tab from left to right? > Example: I have 3 tabs, when I click to any tab then it moves that > from left to right and it puts as last one. Does exist any solution > for this? > > Jan >
[jQuery] Re: jquery-DatePicker
I can give you some ideas perhaps, I am assuming you know which dates you want to be marked. See and try to understand the HTML that the datepicker generates for the calendar. Then try and add css attributes to these dates with which you can indicate them as marked, along with that you could also add some hover() functionality as per your needs Thanks & Regards, Dhruva Sagar. Charles de Gaulle<http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html> - "The better I get to know men, the more I find myself loving dogs." On Fri, Aug 21, 2009 at 7:18 PM, tola wrote: > > my major problem is this : I have the datepicker calendar > working quite well on the web page [using something like > this ... $(function()$('#datepicker').datepicker({ > changemonth:true, changeYear: true > }); ) ], but i want to add more functionalities to the > calendar , which includes marking the calendar (that is having > the css mark the day with tasks) and getting it display when > you mouseover the day . The BIG probs is trying to write a > working java code in the jquery script. I know it sounds > weird but is there a way out ??. > > Thanks, > Tola. > > On Aug 21, 1:18 am, Dhruva Sagar wrote: > > Can you please explain/elaborate the use case?Ideally you would simply > get 1 > > date from the database which you can set to the input box to which you > have > > bound the datePicker. > > > > Thanks & Regards, > > Dhruva Sagar. > > > > Samuel Goldwyn< > http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> > > - "I'm willing to admit that I may not always be right, but I am never > > wrong." > > > > > > > > On Fri, Aug 21, 2009 at 5:14 PM, tola wrote: > > > > > Has anyone ever used the datepicker to add event from a > > > database to a calendar ??? trying to connect to the > > > database from the datepicker has been taking alot of my > > > time . Please , i need help.- Hide quoted text - > > > > - Show quoted text -
[jQuery] Re: Dynamic AJAX call on element show()/toggle()
Well there could be several solutions to what you wish to achieve. I'll give you one quick one that I can think of right now. create the div's with a particular class, say IP_click. and then do $('.IP_click').click(function(){ $(this).children('.IP').toggle().ajax(function(){ //call page here; }); }); *NOTE: in your example your using ID's, now technically you can't have OR you aren't supposed to have multiple DOM elements with the same ID, even if you do (by mistake or whatever) the $('#ID') would always return the first DOM element with that ID.* Now coming to the piece of code I wrote above, that will essentially help you do what you want, but taking this to the next level, I am assuming that for each of the div's you might have some specific data that you will be posting to the server to get the specific results back, for that you could again have several solutions, one would be to simple have hidden fields with that data within the div's. Hope it helps, or you might have to be a little more specific perhaps. Thanks & Regards, Dhruva Sagar. Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> - "The trouble with a kitten is that when it grows up, it's always a cat." On Fri, Aug 21, 2009 at 6:51 PM, Wrenbjor wrote: > > I want to be a little more clear. I don't want someone to write this > for me, I want to understand the process on how to do it. I think it > will rely on chaining events, so I think I need a better understanding > on how to make that work. > > On Aug 20, 4:34 pm, Wrenbjor wrote: > > ok I am using the table expanding code found herehttp:// > www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-wit... > > > > basicily it hides the even rows on the table and when you click a row > > that is shown (a master row) the row under it slides into place. it > > works great but it's built on the premeiss that the content in the > > hidden rows is loaded on page load and just waiting to be displayed. I > > am looking to make this dynamic and cant think how to do it. > > > > this is what I want: the main table will load with data in the master > > rows. this will be something like a server IP or a FQDN. when the user > > clicks on the master row the next TR under it will slide into place > > and an ajax call will happen displaying server stats in the newly > > shown TR. I dont want to load this data on page load because it might > > be a list of 500+ servers. so I need it one at a time on TR click. So > > my thought was to make one of the TD's in the master row contain a div > > with an ID of IP_click and the hidden TR have a TD with a div that has > > an ID of IP. so I would call > > > > $("#IP_click").click(function(){ > > $("#IP").toggle().ajax(function(){ > > call page here; > > > > }); > > }); > > > > Now I would love to write one function so that I dont have a JQ call > > for each server $("#IP1_click) $("#IP2_click") etc... so I think I'm > > close I just cant figure how to get the dynamic id's to the function > > call. I am using PHP if that helps.
[jQuery] Re: jquery-DatePicker
Can you please explain/elaborate the use case?Ideally you would simply get 1 date from the database which you can set to the input box to which you have bound the datePicker. Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Fri, Aug 21, 2009 at 5:14 PM, tola wrote: > > Has anyone ever used the datepicker to add event from a > database to a calendar ??? trying to connect to the > database from the datepicker has been taking alot of my > time . Please , i need help. >
[jQuery] Re: Replace select with it's value.
It is possible.This is a pseudocode : $('table').children('select').each(function(){ $(this).parent().append($(this).val()); $(this).remove() //you could do .hide() if you just want to hide them }); Thanks & Regards, Dhruva Sagar. Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Fri, Aug 21, 2009 at 3:36 PM, henrikaagaardsoren...@gmail.com < henrikaagaardsoren...@gmail.com> wrote: > > Is it possible to run through an entire table and replace all > instances of select with it's value instead?
[jQuery] Re: Having a problems with $.post() and external .js files
In my opinion the problem of it not triggering the second time when your .php file has loaded a new form is because it is a new .select tag!The not triggering has nothing to do with including of the .js file. What you need to ensure is after the $.post, when you update the form using $('#searchbox').html(data); you should at the same time actually be attaching the 'change' trigger to the '.selector' I hope you understand. Here is how it should be done in my opinion : function onSelectorChange() { $("#loadingbox").show(); var brand = $('#brand').val() var oldbrand = $('#oldbrand').val() var model = $('#model').val() var freegift = $('#freegift').val() var minutes = $('#minutes').val() var texts = $('#texts').val() var contractlength = $('#contractlength').val() var price = $('#price').val() var phoneprice = $('#phoneprice').val() var selectednetworks = []; $('@name=network:checked').each(function() { selectednetworks.push($(this).val()); }); $.post("searchformbox.php", { 'selectednetworks[]':selectednetworks, phoneprice: phoneprice, price: price, brand: brand, model: model, freegift: freegift, minutes: minutes, texts: texts, contractlength: contractlength, oldbrand: oldbrand }, onPost } $('.selector').change(onSelectorChange); function onPost() { $("#searchbox").html(data); $('.selector').change(onSelectorChange); } I hope the syntax & the bracket '{', '}' are in correct order above. But more importantly I hope you get the idea... Thanks & Regards, Dhruva Sagar. Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> - "Sports is like a war without the killing." On Fri, Aug 21, 2009 at 2:52 PM, m...@polyvisual.co.uk < m...@polyvisual.co.uk> wrote: > > Hi all, > > Can someone help? I'm having a problem with $.post() and including > external .js files. > > I include my jquery in the header of each page: > > > > I have a php file which includes a form [an external php file called > searchformbox.php]. Each time a is changed in the > form, jquery handles the submit by doing a $.post() and sending all > the form variables back to searchformbox.php. The searchformbox.php > with the new form options is reloaded its by using .html() > > What I have found, is that if I don't re-include the external .js file > in searchformbox.php, the jquery does not trigger the second time a > is changed. > > The answer [it seems] is to re-include the external .js file in > searchformbox.php. However, this causes the jquery to be triggered > twice (obviously causing twice the number of mysql queries and a GET > to reload the common.js file). > > I [think I] understand why the jquery is triggered twice, but I can't > understand how to stop it. It seems like a catch 22 problem... can > anyone help? > > Thanks :) > > Here's the jquery I use for the form resubmit [each has the > class .selector]: > > $(".selector").change(function(){ > > $("#loadingbox").show(); > > > var brand = $('#brand').val() > var oldbrand = $('#oldbrand').val() > var model = $('#model').val() > var freegift = $('#freegift').val() > var minutes = $('#minutes').val() > var texts = $('#texts').val() > var contractlength = $('#contractlength').val() > var price = $('#price').val() > var phoneprice = $('#phoneprice').val() > > var selectednetworks = []; >$('@name=network:checked').each(function() { > selectednetworks.push($(this).val()); >}); > > $.post("searchformbox.php", { > 'selectednetworks[]':selectednetworks, phoneprice: phoneprice, price: > price, brand: brand, model: model, freegift: freegift, minutes: > minutes, > texts: texts, contractlength: contractlength, oldbrand: oldbrand }, > > function(data){ > $("#searchbox").html(data); > } > ); > > });
[jQuery] Re: add value from listbox to textbox
In fact you have to re-check the *id* of both the 'select' box and the 'text-box'.It should work if these two are correct. Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Fri, Aug 21, 2009 at 2:30 PM, Tan wrote: > > yes, i have to change code to: > http://www.w3.org/ > TR/html4/strict.dtd"> > > > test > > http://jqueryjs.googlecode.com/</a> > files/jquery-1.3.2.min.js"> > > $(document).ready(function(){ > $('#edit-default-source').change(function() { > $('#edit-field-soure-0-value').text($(this).val()); > }); > }); > > > > > hongkiat.com > smashingmagazine.com > > > > > > > > > > But it's not works. i want to take "hongkiat.com",... in in textbox > when select listbox. > Please help me! > > On Aug 21, 3:29 pm, Dhruva Sagar wrote: > > For the listbox you should simply use the function *change *i'll give an > > example : > > > > $('#edit-default-source').change(function() { > > $('#edit-field-soure-0-value').text($(this).val()); > > > > }); > > > > This should do what you want (if I correctly understood it), once you > select > > an option in the select drop down box, the text box will get populated > with > > the selected value. > > > > Thanks & Regards, > > Dhruva Sagar. > > > > Marie von Ebner-Eschenbach< > http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac> > > - "Even a stopped clock is right twice a day." > > > > > > > > On Fri, Aug 21, 2009 at 10:37 AM, Tan wrote: > > > > > i have to create a listbox and a textbox. > > > I want to select value form listbox then this value shows in textbox > > > > > > http://www.w3.org/ > > > TR/html4/strict.dtd"> > > > > > > > > > test > > > > > > http://jqueryjs.googlecode.com/</a> > > > files/jquery-1.3.2.min.js"> > > > > > > $(document).ready(function(){ > > > $('#edit-default-soure').change(function(){ > > > var str = ""; > > > $("#edit-default-soure option:selected").each(function () { > > >str += $(this).text() + " "; > > > }); > > > $("#edit-field-sourc-0-value").text(str); > > >}) > > >.change(); > > > > > }); > > > > > > > > > > > > > > hongkiat.com > > > smashingmagazine.com > > > > > > > > > > > > > > > > > > > > > > > > > > But it's not work. > > > Please help!- Hide quoted text - > > > > - Show quoted text -
[jQuery] Re: add value from listbox to textbox
Well, I re-read your HTML, and I see that the 'id' of the text box you have mentioned is 'edit-field-sourc-0-value', please just make sure the spellings of the 'id' of the text field are right, exactly as you have in your HTML Thanks & Regards, Dhruva Sagar. Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Fri, Aug 21, 2009 at 2:30 PM, Tan wrote: > > yes, i have to change code to: > http://www.w3.org/ > TR/html4/strict.dtd"> > > > test > > http://jqueryjs.googlecode.com/</a> > files/jquery-1.3.2.min.js"> > > $(document).ready(function(){ > $('#edit-default-source').change(function() { > $('#edit-field-soure-0-value').text($(this).val()); > }); > }); > > > > > hongkiat.com > smashingmagazine.com > > > > > > > > > > But it's not works. i want to take "hongkiat.com",... in in textbox > when select listbox. > Please help me! > > On Aug 21, 3:29 pm, Dhruva Sagar wrote: > > For the listbox you should simply use the function *change *i'll give an > > example : > > > > $('#edit-default-source').change(function() { > > $('#edit-field-soure-0-value').text($(this).val()); > > > > }); > > > > This should do what you want (if I correctly understood it), once you > select > > an option in the select drop down box, the text box will get populated > with > > the selected value. > > > > Thanks & Regards, > > Dhruva Sagar. > > > > Marie von Ebner-Eschenbach< > http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac> > > - "Even a stopped clock is right twice a day." > > > > > > > > On Fri, Aug 21, 2009 at 10:37 AM, Tan wrote: > > > > > i have to create a listbox and a textbox. > > > I want to select value form listbox then this value shows in textbox > > > > > > http://www.w3.org/ > > > TR/html4/strict.dtd"> > > > > > > > > > test > > > > > > http://jqueryjs.googlecode.com/</a> > > > files/jquery-1.3.2.min.js"> > > > > > > $(document).ready(function(){ > > > $('#edit-default-soure').change(function(){ > > > var str = ""; > > > $("#edit-default-soure option:selected").each(function () { > > >str += $(this).text() + " "; > > > }); > > > $("#edit-field-sourc-0-value").text(str); > > >}) > > >.change(); > > > > > }); > > > > > > > > > > > > > > hongkiat.com > > > smashingmagazine.com > > > > > > > > > > > > > > > > > > > > > > > > > > But it's not work. > > > Please help!- Hide quoted text - > > > > - Show quoted text -
[jQuery] Re: Simplemodal close confirm
Seems like your using the SimpleModal jQuery plugin.I am not sure what happens after you call $.modal.close(); does that remove() the dialog from the DOM? or does it change the #content in any way? Thanks & Regards, Dhruva Sagar. Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Fri, Aug 21, 2009 at 1:22 PM, Jirka wrote: > > Hi, I want create a confirmation of close in Simple modal. I try make > this code: > > $(\"#content\").modal({onClose: function (dialog) { > if (confirm(\"Realy close?\")){ > dialog.data.fadeOut('slow', function () { >dialog.container.slideUp('slow', function () { > dialog.overlay.fadeOut('slow', function () { > $.modal.close(); > }); >}); > }); > } > }}); > > It works, but only for first time. When i click to close button second > time, is makes nothing. Can You help me? Thanks >
[jQuery] Re: add value from listbox to textbox
For the listbox you should simply use the function *change *i'll give an example : $('#edit-default-source').change(function() { $('#edit-field-soure-0-value').text($(this).val()); }); This should do what you want (if I correctly understood it), once you select an option in the select drop down box, the text box will get populated with the selected value. Thanks & Regards, Dhruva Sagar. Marie von Ebner-Eschenbach<http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html> - "Even a stopped clock is right twice a day." On Fri, Aug 21, 2009 at 10:37 AM, Tan wrote: > > i have to create a listbox and a textbox. > I want to select value form listbox then this value shows in textbox > > http://www.w3.org/ > TR/html4/strict.dtd"> > > > test > > http://jqueryjs.googlecode.com/</a> > files/jquery-1.3.2.min.js"> > > $(document).ready(function(){ > $('#edit-default-soure').change(function(){ > var str = ""; > $("#edit-default-soure option:selected").each(function () { >str += $(this).text() + " "; > }); > $("#edit-field-sourc-0-value").text(str); >}) >.change(); > > > > }); > > > > > hongkiat.com > smashingmagazine.com > > > > > > > > > But it's not work. > Please help! >
[jQuery] Re: Using $.ajax to post XML to an aspx page
@kcrichard this is from the jquery site *Sends an xml document as data to the server. By setting the processData option to false, the automatic conversion of data to strings is prevented.* var xmlDocument = [create xml document]; $.ajax({ url: "page.php", processData: false, data: xmlDocument, success: handleResponse }); Perhaps that is what your looking for? Thanks & Regards, Dhruva Sagar. Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> - "The trouble with a kitten is that when it grows up, it's always a cat." On Thu, Aug 20, 2009 at 9:12 AM, Jules wrote: > > Can't you pass the xml as a string and load it to dom on the server > side? > > On Aug 19, 1:39 am, Karl wrote: > > I'm new to using JQuery and I've been searching everywhere to be able > > to post XML to a WebMethod on an aspx page in a site. I'm sure it can > > be done but I just have no idea how. > > > > Any help would be greatly appreciated!
[jQuery] Re: need help with logic
It is of course possible, you have to simply redirect the user from the server to the right page. If in the the first scenario you have a page like 'search.php' and your form is submitting the data to it, and your doing the search on server side and displaying it on the same page, then in that case when you've moved the search form to another page, you will need to make sure that the 'action' attribute of this particular form still points to the 'search.php'. If how your submitting data to the server and how you get it back and display is different than that, then you will have to give a bit of details, for example if your working in Ruby on Rails and your submitting the data to the controller where your doing the actual search, then from there you can easily redirect to the search action page... Give a bit more details and I could help you more. Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Thu, Aug 20, 2009 at 6:07 AM, efet wrote: > > I have search page. At this page, when user enters a value to the form > field and clicks submit, the value is posted and server's results > printed inside main div. Now, I want to add search form to main page > and so when user enters a value to the form field and clicks submit, > he is redirected to search page and the entered value is posted and > server's results printed inside main div. Is this possible? If yes, > how?
[jQuery] Re: Is this sytax legitimate?
Glad it helped :), the sequence problem is something that has caught me off guard quite a few times :).Hope you've worked it all out. Thanks & Regards, Dhruva Sagar. Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Thu, Aug 20, 2009 at 6:44 AM, Dhruva Sagar wrote: > 1 thing you need to make sure is that you must call this script of line > (mentioned below in your mail), only after the '#favorites' has been > updated, if the contents of the '#favorites' is changing dynamically then > you will get weird results. > ------ > > Thanks & Regards, > Dhruva Sagar <http://www.dhruvasagar.net/blog/>. > > On Wed, 2009-08-19 at 13:41 -0400, Rick Faircloth wrote: > > $('.menu1').append($('#favorites').html()); > > > > I get no errors in firebug when it’s run, but not code appended to .menu1, > either… > > > > > > > -- > > *"Ninety percent of the politicians give the other ten percent a bad > reputation." - Henry Kissinger* > > > > >
[jQuery] Re: Is this sytax legitimate?
1 thing you need to make sure is that you must call this script of line (mentioned below in your mail), only after the '#favorites' has been updated, if the contents of the '#favorites' is changing dynamically then you will get weird results. ____ Thanks & Regards, Dhruva Sagar. On Wed, 2009-08-19 at 13:41 -0400, Rick Faircloth wrote: > $('.menu1').append($('#favorites').html()); > > > > I get no errors in firebug when it’s run, but not code appended > to .menu1, either… > > > > > > -- > > "Ninety percent of the politicians give the other ten percent a bad > reputation." - Henry Kissinger > > > > <>
[jQuery] Re: Is this sytax legitimate?
It depends on what $('#favorites').html() contains, have you checked that? Are you sure the id is correct? The syntax by itself is absolutely correct, but what you should see in your site is something that depends on a lot of things such as what the $('menu1') contains and what it should etc...try checking if the .html() is returning the right data, then check if it is actually getting appended using firebux, after you have reached that stage and confirmed the same check if the styles are right... Thanks & Regards, Dhruva Sagar. Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Wed, Aug 19, 2009 at 11:11 PM, Rick Faircloth wrote: > $('.menu1').append($('#favorites').html()); > > > > I get no errors in firebug when it’s run, but not code appended to .menu1, > either… > > > > > > > -- > > *"Ninety percent of the politicians give the other ten percent a bad > reputation." - Henry Kissinger* > > >
[jQuery] Re: How to refresh a single div with the data using .ajax
You should then try to parse the 'data' and then get it from it.But in my opinion, you should add some additional post params to the post request, say such as {'data': ''#div'} and then in some.php you can conditionally only return the contents of the div you want instead of the complete 'data' Thanks & Regards, Dhruva Sagar. Charles de Gaulle<http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html> - "The better I get to know men, the more I find myself loving dogs." On Tue, Aug 18, 2009 at 4:24 PM, Charlie wrote: > $.load() lets you get specific elements only like this $.load ("some.php > #div) > > I have not done this with a full $.ajax but since they are using same > jQuery, in your $.ajax try > > url: some.php #div > > ghost2008 wrote: > > Hello there, > > I am not sure, if this works. I make a function call with the ajax > option of jquery: > > $.ajax({ > type: "POST", > url: "some.php", > data: "name=test", > success: function(data){ > $("#div").html(data); > } > }); > > If I try this, the whole response data is shown in the specific #div. > Is there any possibility to load only the content of "#div" from > some.php? > > Thanks for your answers. > Regards > > > > >
[jQuery] Re: JSON how to transform an object into an array?
Also to note, after you have eval 'ed it, you can then access the data in this manner as per your data structure : data[0].id, so on Thanks & Regards, Dhruva Sagar. Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html> - "I, Joan Crawford, I believe in the dollar. Everything I earn, I spend." On Wed, Aug 12, 2009 at 3:27 PM, Mark wrote: > > yeah that i was thinking to but the problem is that you get. > > [object Object] > > if you alert out data again. > > On Aug 12, 11:53 am, Dhruva Sagar wrote: > > I think this is what you are looking for > > > > data = eval ( '(' + data + ')' ); > > > > Thanks & Regards, > > Dhruva Sagar. > > > > Jonathan Swift< > http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> > > - "May you live every day of your life." > > > > On Wed, Aug 12, 2009 at 3:18 PM, Mark wrote: > > > > > Hi all. > > > I got an php page who picks up data out of my data base and puts it in > > > a multidimensinal array. That array is being encoded to Json > > > > > $event = json_encode($super_array); > > > > > Then i made an javasript get funtion to get that array to my main > > > page. > > > > > function get(){ > > > $.get("../position of my file/test.php", > function(data){ > > >alert (""+data); > > >}); > > > > > The var data doesn't give me an array it gives me an object while i > > > programmed it to give me an array (inplace of force_object): > > > > > {"5": > > > > > > {"id":"5","title":"test","start_datum":"6161616","end_datum":"663461","afspraak_type":"memo"},"10": > > > > > > {"id":"10","title":"bla","start_datum":"4819028","end_datum":"8230948","afspraak_type":"verjaardag"}} > > > > > What i need to have is that it gives me an array that looks something > > > like this: > > > > > [ > > > { > > > id:5, > > > title:test, > > > start_datum:6161616, > > > end_datum: 663461, > > > afspraak_type: Memo > > > } > > > { > > > id:10, > > > title:bla, > > >start_datum: 4819028, > > >end_datum:8230948, > > >afspraak_type:Verjaardag > > > } > > > ] > > > What is the best way to get to this? > > > > > Mark >
[jQuery] Re: JSON how to transform an object into an array?
Well because it is an object.If you using firefox you should try alert(data.toSource()); after you've done the eval. But also to keep in mind like Liam Potter suggested you should use $.getJSON and you wont have to do the eval. Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Wed, Aug 12, 2009 at 3:27 PM, Mark wrote: > > yeah that i was thinking to but the problem is that you get. > > [object Object] > > if you alert out data again. > > On Aug 12, 11:53 am, Dhruva Sagar wrote: > > I think this is what you are looking for > > > > data = eval ( '(' + data + ')' ); > > > > Thanks & Regards, > > Dhruva Sagar. > > > > Jonathan Swift< > http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> > > - "May you live every day of your life." > > > > On Wed, Aug 12, 2009 at 3:18 PM, Mark wrote: > > > > > Hi all. > > > I got an php page who picks up data out of my data base and puts it in > > > a multidimensinal array. That array is being encoded to Json > > > > > $event = json_encode($super_array); > > > > > Then i made an javasript get funtion to get that array to my main > > > page. > > > > > function get(){ > > > $.get("../position of my file/test.php", > function(data){ > > >alert (""+data); > > >}); > > > > > The var data doesn't give me an array it gives me an object while i > > > programmed it to give me an array (inplace of force_object): > > > > > {"5": > > > > > > {"id":"5","title":"test","start_datum":"6161616","end_datum":"663461","afspraak_type":"memo"},"10": > > > > > > {"id":"10","title":"bla","start_datum":"4819028","end_datum":"8230948","afspraak_type":"verjaardag"}} > > > > > What i need to have is that it gives me an array that looks something > > > like this: > > > > > [ > > > { > > > id:5, > > > title:test, > > > start_datum:6161616, > > > end_datum: 663461, > > > afspraak_type: Memo > > > } > > > { > > > id:10, > > > title:bla, > > >start_datum: 4819028, > > >end_datum:8230948, > > >afspraak_type:Verjaardag > > > } > > > ] > > > What is the best way to get to this? > > > > > Mark >
[jQuery] Re: JSON how to transform an object into an array?
I think this is what you are looking for data = eval ( '(' + data + ')' ); Thanks & Regards, Dhruva Sagar. Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Wed, Aug 12, 2009 at 3:18 PM, Mark wrote: > > Hi all. > I got an php page who picks up data out of my data base and puts it in > a multidimensinal array. That array is being encoded to Json > > $event = json_encode($super_array); > > Then i made an javasript get funtion to get that array to my main > page. > > function get(){ > $.get("../position of my file/test.php", function(data){ >alert (""+data); >}); > > The var data doesn't give me an array it gives me an object while i > programmed it to give me an array (inplace of force_object): > > {"5": > > {"id":"5","title":"test","start_datum":"6161616","end_datum":"663461","afspraak_type":"memo"},"10": > > {"id":"10","title":"bla","start_datum":"4819028","end_datum":"8230948","afspraak_type":"verjaardag"}} > > What i need to have is that it gives me an array that looks something > like this: > > [ > { > id:5, > title:test, > start_datum:6161616, > end_datum: 663461, > afspraak_type: Memo > } > { > id:10, > title:bla, >start_datum: 4819028, >end_datum:8230948, >afspraak_type:Verjaardag > } > ] > What is the best way to get to this? > > Mark > >
[jQuery] Re: Refresh DIV with full page refresh
What exactly do you mean by 'refresh DIV' ?If you want to get some content in the page and update the DIV without loading/refreshing the entire page, then you should use ajax calls to your server. If you can explain what you want in a bit more detail perhaps I could help you a bit more. Thanks & Regards, Dhruva Sagar. Ogden Nash <http://www.brainyquote.com/quotes/authors/o/ogden_nash.html> - "The trouble with a kitten is that when it grows up, it's always a cat." On Tue, Aug 11, 2009 at 6:28 PM, bharani kumar < bharanikumariyer...@gmail.com> wrote: > Hi All , > > How to refresh DIV , without refresh entire page, > > Am having four DIV , > > DIV1,DIV2,DIV3,DIV4 > > > I want to refresh only DIV! without affecting the DIV3,DIV4 , > > Thanks >
[jQuery] Re: help needed retrieving json data with jquery
It should be json[i].title as per your json. Thanks & Regards, Dhruva Sagar. On Fri, 2009-08-07 at 09:38 -0700, efet wrote: > There is not a single clear example that explains how to pull json > data as simple as possible. I have a valid json and I need to retrieve > it with jquery > > my json output is as: > > { > "title": "blog entries", > "items" : [ > { > "title": "Can Members of the Diaspora Work Effectively at > th", > "date": "8/4/2009 9:42:38 AM" > }, > { > "title": "Ashoka Brazil", > "date": "7/15/2009 8:56:12 AM" > }, > { > "title": "Pozitron/Endeavor", > "date": "5/26/2009 8:58:39 PM" > } > ] > } > > my codes. > > $.getJSON("http://www.pangeaadvisors.org/sep123/blog.cs.asp";, > { PROCESS: "ViewBlog" }, function(json) { > for (var i = 0; i < json.length; i++) { > var title = json[i].Title; > $('').html > (title).appendTo('#news_wrap'); > } > }); > <>
[jQuery] Re: Problem with sorting after dragging.
Hi, Have you tried using the connectToSortable option for draggable? Thanks & Regards, Dhruva Sagar. On Mon, 2009-07-27 at 00:21 -0700, freq wrote: > Hi, > > I'm using Jquery to both Drag (and drop) and sort a visual list or > representation of VOIP phones. > > The problem is that after I have dragged (and dropped) a DIV. It will > not sort at all anymore. > > After you have dropped for sorting, the DIV goes back to where I > dropped it with dragging. > > I have tried several thing including disabling sorting just when > starting to drag and enabling it back when dragging is stopped. > > This does not seem to help at all. > > Anyone can help me with this? I would appreciate it at alot. > > Thanks. <>
[jQuery] Re: Getting link ID
Inside the click event handler, the id's should be available using this.idor $(this).attr('id') Thanks & Regards, Dhruva Sagar. Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Thu, Jul 23, 2009 at 4:44 PM, shaf wrote: > > Hi Guys > > i have a click event on my links. Each link has an ID. Is there any > way I can get the link ID when the user clicks it ? See below for > code: > > > > > //JS > $(document).ready(function() { >// Add menu event listeners >var menuItems = ["home", "contact"]; >$.each(menuItems, function(intIndex, nm) { >$("#menu_"+nm).click(function () { >getPage(nm+".htm"); >}); >}); > > });
[jQuery] Re: Catch Exception
It all depends on the data that's returning.I believe the exception would certainly have some data/text that you can use to check if it is an exception and then conditionally update the appropriate div. something like : $(document).ready(function() { $('.DOFFDelete').click(function() { var id = $(this).attr("id"); $.post("/Customer/DayOffDelete", { customerid: getCustomerId(), doffId: id }, function(data) { if ( data.matches('exception) ) $('#myExceptionDiv).html(data); else $("#myFormDOFF").html(data); }); }); }); Thanks & Regards, Dhruva Sagar. Charles de Gaulle<http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html> - "The better I get to know men, the more I find myself loving dogs." On Thu, Jul 23, 2009 at 11:27 AM, Kris-I wrote: > > Hello, > > In my code (ASP.NET MVC using Nhibernate) , I do this : > >$(document).ready(function() { >$('.DOFFDelete').click(function() { >var id = $(this).attr("id"); >$.post("/Customer/DayOffDelete", { customerid: > getCustomerId(), doffId: id }, function(data) { >$("#myFormDOFF").html(data); >}); >}); >}); > > Then I display the result in the DIV named "myFormDOFF" > > Of course, my .NET code can generate exception. I'd like when I > receive an exception didn't change the content of "myFormDOFF" but > display the message send by the exception in another DIV. How can I do > this ? > > Thanks, >
[jQuery] Re: Superfish How to programatically unexpand menus.
Well my suggestion would require you to dig into superfish's code and find the click handler and edit it to suit your needs. Tell me one thing, in case of a simple mouse click, does the menu then disappear ? I think it wouldn't in your case. Can you perhaps give a demo script how your making the ajax call on click event? Thanks & Regards, Dhruva Sagar. Stephen Leacock<http://www.brainyquote.com/quotes/authors/s/stephen_leacock.html> - "I detest life-insurance agents: they always argue that I shall some day die, which is not so." On Tue, Jul 21, 2009 at 12:11 PM, JC wrote: > > You wouldn't suppose you could give a hint of how to do this :) ? > > On Jul 20, 10:13 pm, Dhruva Sagar wrote: > > In the click event, you should also perhaps set the display css of the > menu > > as none so that it hides again. > > Thanks & Regards, > > Dhruva Sagar. > > > > Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> > - > > "Sports is like a war without the killing." > > > > On Tue, Jul 21, 2009 at 10:42 AM, JC > wrote: > > > > > I notice, > > > when someone tabs through with the keyboard, and presses enter on a > > > link, it triggers the click event on that link (which is good) but > > > then the menu stays open.. In my case, I'm not directing the user to a > > > new page, just loading up ajax content, so the menus just hang there > > > open.. I want to close them after a click/pressing enter.. > > > Does anyone know of a way to do this? Or should this go with my gripes > > > about keyboard navigation.
[jQuery] Re: Superfish How to programatically unexpand menus.
In the click event, you should also perhaps set the display css of the menu as none so that it hides again. Thanks & Regards, Dhruva Sagar. Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> - "Sports is like a war without the killing." On Tue, Jul 21, 2009 at 10:42 AM, JC wrote: > > I notice, > when someone tabs through with the keyboard, and presses enter on a > link, it triggers the click event on that link (which is good) but > then the menu stays open.. In my case, I'm not directing the user to a > new page, just loading up ajax content, so the menus just hang there > open.. I want to close them after a click/pressing enter.. > Does anyone know of a way to do this? Or should this go with my gripes > about keyboard navigation.
[jQuery] Re: Selector help
Hi, Perhaps your missing a space? $('this h1'), or $('this ' + 'h1') What I don't understand is, why are you trying to concatenate two strings when you don't need to? ________ Thanks & Regards, Dhruva Sagar. On Sat, 2009-07-18 at 22:05 -0700, Warfang wrote: > I'm pretty new to Javascript/ jQuery, so this is really bugging me. > > I'm trying to get the height of an h1 that is a sibling to this. The > value for the variable h1Height, however, returned as null in the > console in Firebug. Perplexed, I tried console.logging ('this'+'+h1') > to see what it was interpreted as. It brought back this+h1, which > should select an h1 adjacent to this (which is a div). > > Javascript > h1Height = $('this'+'h1').height(); > > What went wrong? <>