[jQuery] Re: .each()

2009-03-31 Thread iceangel89
oh i fixed it. its because i called that after getJSON and getJSON has not set the values yet. :) On Apr 1, 2:46 pm, iceangel89 wrote: > i used .each to select all elements with id that starts with laLab > > $("*[id^=laLab]").each(function (i, obj) { >    alert(obj.attr("value")); > > }); > > bu

[jQuery] .each()

2009-03-31 Thread iceangel89
i used .each to select all elements with id that starts with laLab $("*[id^=laLab]").each(function (i, obj) { alert(obj.attr("value")); }); but i cant do obj.attr("value") nor obj.val(). why is this so? when i alert(obj) its said i got HTML Input Element which is right

[jQuery] Re: Select elements with a prefix for id

2009-03-31 Thread Charlie Griefer
On Tue, Mar 31, 2009 at 8:30 PM, iceangel89 wrote: > > how can i select all elements with a prefix of "Lab" > > i have textboxes with ids like Lab1, Lab2, Lab3 ... $("textarea[id^='Lab']") http://docs.jquery.com/Selectors/attributeStartsWith#attributevalue -- I have failed as much as I have s

[jQuery] Re: distinguishing between clicks on an outer container vs an "inner link"

2009-03-31 Thread RobG
On Apr 1, 10:03 am, Ricardo wrote: > Or access the id property directly: > > $("#row33").click( function(e) { >     if( e.target.id == "innerX") { That is certainly more efficient and less problematic than using attr (), but not a very good strategy. I think you mean to reply to the OP, not m

[jQuery] Re: selecting spans with an attribute of "for"

2009-03-31 Thread RobG
On Apr 1, 9:55 am, Ricardo wrote: Please only reply to me if you are commenting on something I posted (which is difficult to do as you continuously top post). Otherwise, reply to the OP (or whichever post you are replying to). > Even being invalid this is unexpected. Sizzle maps "for" to "ht

[jQuery] Re: Append asterisk to required field labels

2009-03-31 Thread Baum
Thanks James. I am just getting started with jQuery so the syntax is rather new. What I found is that the jquery-1.3.2.js file that I am using as part of the asp.net MVC release does not appear to work with each syntax (I only get the first input field back). I reverted back to 1.2.6 and it appea

[jQuery] A Tree which can be filtered or searched....

2009-03-31 Thread Ravish
Hi, I've been looking for a tree widget which can be filtered or searched by typing keyword in a textbox. When trees have thousands of nodes, its very difficult for users to browse manually. Has anyone ever seen such a widget (jquery based ideally but other will do as well). I am surprised to

[jQuery] Select elements with a prefix for id

2009-03-31 Thread iceangel89
how can i select all elements with a prefix of "Lab" i have textboxes with ids like Lab1, Lab2, Lab3 ...

[jQuery] Re: jQuery/ HTML help needed

2009-03-31 Thread Ricardo
Actually this is the perfect opportunity to put those href's into use: slide 1 slide 2 slide 3 slide 1 slide 2 slide 3 The script: $('#tab_links a').click(function(){ var activeTab = $(this).attr('href'); $(activeTab).fadeIn(500); ret

[jQuery] Re: can someone take a look please...

2009-03-31 Thread Ricardo
Didn't notice the link, jack's right: should be (as you declared your page XHTML 1.0 Transitional, you must close the input element) cheers, - ricardo On Mar 31, 11:18 pm, Jack Killpatrick wrote: > When I use firebug to see what's in the HTML I only see: > > > > - Jack > > webguy262 wrote:

[jQuery] [validate] How can I force element validation if the value is unchanged?

2009-03-31 Thread pbarnes
I need to use an ASMX service to validate a phone number. The Web method requires the phone number and the countryId. I have the validation working fine except for the case where the user enters a valid number for, say, the default country (United States) and then selects some other country, not

[jQuery] Re: can someone take a look please...

2009-03-31 Thread Jack Killpatrick
When I use firebug to see what's in the HTML I only see: - Jack webguy262 wrote: Jack I think I've got that, don't I? >From my post... Am I missing something? Jack Killpatrick wrote: try adding id="partnum" to the form field that has name="partnum". - Jack webguy262 w

[jQuery] Re: Append asterisk to required field labels

2009-03-31 Thread James
How about something like: $required = $(".required"); // list of elements with 'required' class. $.each($required, function(i) { var id = $(this).attr('id'); var $label = $("label[for="+id+"]"); $label.text( $label.text()+'*' ); }); The requirement is that all your .required input

[jQuery] Re: can someone take a look please...

2009-03-31 Thread Steven Yang
do you have anything in the html also with name="partnum"?because in IE the getElementById actually get the name first if you use jQuery simply try $("#partnum").val(result)

[jQuery] Re: Append asterisk to required field labels

2009-03-31 Thread Baum
One note the javascript included in the original post is incorrect...I was playing around and pasted the wrong copy...remove the each(). Also var size = $(".required").size(); is equal to 1 but var size = $ ("input").size(); is equal to 2. Thanks. On Mar 31, 7:56 pm, Baum wrote: > Hi, > > I am

[jQuery] Append asterisk to required field labels

2009-03-31 Thread Baum
Hi, I am looking to use jQuery in conjunction with xVal for validation. One of the cool things I though jQuery would allow me to do is append an asterisk (*) to the label of "ALL" my fields that have a css class of "required". The example below only applies the asterisk to the first field. How c

[jQuery] IE freez when I open a page with tabs.

2009-03-31 Thread amit
Hi All, I am having a problem recently. I am using jQuery-1.3.2.min and my page freeze. It force me to kill the IE from task manager. But strange thing is, it was working fine earlier, all of sudden I don't know why its creating problems. My content page is huge and I thought may be its lot of dat

[jQuery] Re: jQuery/ HTML help needed

2009-03-31 Thread James
You're making it more complicated than it really is. Using something similar to Jonathan's method: // Change your id to something like 'link_1', like here: slide 1 var activeTabID = $(this).attr('id'); // -> link_1 var activeTab = activeTabID.split('_')[1]; // -> 1 $('#tab_'+activeTab).fadeIn

[jQuery] Re: selecting spans with an attribute of "for"

2009-03-31 Thread Captain Betty
Thanks everyone. Yes, I know the "for" attribute is reserved for labels. Reason I ask is that I'm using Validator and was trying to target a span for a group of check boxes where at least one needed to be selected to validate the form. I'll probably switch back to a label (which semantically ma

[jQuery] Re: jQuery/ HTML help needed

2009-03-31 Thread Warfang
Could I do something like this?... var activeTab = $(this).attr('id'); $(''#(activeTab)'').fadeIn(500); Those are two single quotes by the way. That is what I would like to accomplish.

[jQuery] Re: jQuery/ HTML help needed

2009-03-31 Thread Warfang
Sorry for not explaining this well. In the first line, "(this)" is the link that you click. The the id is used as a selector to select the "tab" that relates to that link. What I'd like to do is something like this: var activeTab = [single quote here] $(this).attr("id") [single quote here]; Is

[jQuery] Re: jQuery/ HTML help needed

2009-03-31 Thread Jonathan
ID's have to start with a letter like the validator and james said. You didn't really explain why, you just showed a block of code. I think I get what you're trying to do but you really shouldn't be using IDs like that. ID's are a unique way to IDentify an element, not to get tricky with linking

[jQuery] Re: Validation Success Callback

2009-03-31 Thread James
Slight typo on the second option: setTimeOut(doSomething, 5000); function doSomething() { window.location = 'http://www.google.com'; } On Mar 31, 2:31 pm, James wrote: > In some common ways, you'd have to either do it: > > setTimeOut(function() { >      window.location = 'http://www.goog

[jQuery] Re: Validation Success Callback

2009-03-31 Thread James
In some common ways, you'd have to either do it: setTimeOut(function() { window.location = 'http://www.google.com'; }, 5000); or: setTimeOut(doSomething, 5000); doSomething() { window.location = 'http://www.google.com'; } or: setTimeout('window.location = "http://www.google.com";',

[jQuery] Re: Validation Success Callback

2009-03-31 Thread MonkeyBall2010
setTimeout(window.location = "http://www.google.com";, 5000); It seems that the script just completely ignores the timeout but executes the code anyways... What is really weird is that if I put some other code on a timer then it works correctly so maybe I am doing the redirect wrong?? On Mar 30,

[jQuery] Re: jQuery/ HTML help needed

2009-03-31 Thread James
I'm not sure I understand what you're trying to do. Having the # and single-quotes in the id is invalid. I'm not sure how having it there is suppose to make things work. Similar to jQuery UI Tabs, maybe you should consider putting "tab_1" inside the 's 'title' attribute instead: slide 1 If you r

[jQuery] Re: jQuery/ HTML help needed

2009-03-31 Thread Warfang
Yes, but I explained why... "I, though, used single quote marks so that it worked with the second line of script that I showed you." I just need to know what to put in the var line so that I can remove those quotes. On Mar 31, 7:49 pm, James wrote: > slide 1 > is suppose to be: > slide 1

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread Ricardo
You can store data in the class attribute. See the jquery.metadata plugin: http://docs.jquery.com/Plugins/Metadata. You can also use the data() method in jQuery, it's meant for this. - ricardo On Mar 31, 6:42 pm, Eric Garside wrote: > Right, but the problems with that approach is inefficiency.

[jQuery] Re: distinguishing between clicks on an outer container vs an "inner link"

2009-03-31 Thread Ricardo
Or access the id property directly: $("#row33").click( function(e) { if( e.target.id == "innerX") { ; // do inner link things } else { ; // do outer click things } }); You can also stop propagation to isolate the inner click: $('#row33').click(function(){ // do stuff

[jQuery] Re: selecting spans with an attribute of "for"

2009-03-31 Thread Ricardo
Even being invalid this is unexpected. Sizzle maps "for" to "htmlFor", because in labels the for value is held in the htmlFor property (for being a reserved word). If you had you could get it with $('span[for=tea]') in example. In your case you have to resort to $('span').filter(function(){

[jQuery] Re: jQuery/ HTML help needed

2009-03-31 Thread James
slide 1 is suppose to be: slide 1 On Mar 31, 1:36 pm, Warfang wrote: > Alright, heres the situation: I'm creating a tabbed box with jQuery > and with some HTML tricks. The code that I came up with works great > but is considered invalid markup by W3 standards. > > HTML: > >         slide 1 >  

[jQuery] Re: distinguishing between clicks on an outer container vs an "inner link"

2009-03-31 Thread RobG
On Apr 1, 3:15 am, "james.kirin40" wrote: > Hi everyone! > > A brief question from a newbie. I have a table row which I want to be > clickable, but I have a specific link within one cell. Something like: > > >     >         inner link! >     > > > I want to have the clicks on the inner link

[jQuery] jQuery/ HTML help needed

2009-03-31 Thread Warfang
Alright, heres the situation: I'm creating a tabbed box with jQuery and with some HTML tricks. The code that I came up with works great but is considered invalid markup by W3 standards. HTML: slide 1 slide 2 slide 3 slide 1

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread Mauricio (Maujor) Samy Silva
Right, but the problems with that approach is inefficiency. It's more efficient to grab the entire set of elements via $('.event-phase') and comparing their "rel" attribute than it is to throw a loop around $ ('.event-phase-' + i); I think it depends upon the context. If the loop is needed fo

[jQuery] Re: Modifying CSS classes with jQuery (or '.live()' for '.css')

2009-03-31 Thread Ricardo
You can modify the CSS rules directly, see this plugin: http://flesler.blogspot.com/2007/11/jqueryrule.html I wrote this a while back, not thorougly tested. I guess adding a new class rule to the end of the stylesheet will override previous rules (this only adds to the first stylesheet in the doc

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread brian
On Tue, Mar 31, 2009 at 5:42 PM, Eric Garside wrote: > > Right, but the problems with that approach is inefficiency. It's more > efficient to grab the entire set of elements via $('.event-phase') and > comparing their "rel" attribute than it is to throw a loop around $ > ('.event-phase-' + i); W

[jQuery] Re: selecting spans with an attribute of "for"

2009-03-31 Thread RobG
On Apr 1, 4:44 am, Captain Betty wrote: > Hi everyone. > > I have a weird issue with selecting spans with the “for” attribute. > jQuery doesn’t seem to want to select it if the span is physically on > the page. [...] > Is this a bug? What am I doing wrong in trying to select a span on the > pag

[jQuery] Re: will two JQuery libs conflicts?

2009-03-31 Thread brian
If you're only including some functions from the other site, rather than the actual jquery file, there *might not* be a problem. On Tue, Mar 31, 2009 at 2:16 PM, Xu wrote: > > Let say I have one web page that contains html/js snippets from > another web site. If we both use JQuery. > The two JQu

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread RobG
On Apr 1, 7:42 am, Eric Garside wrote: > Right, but the problems with that approach is inefficiency. It's more > efficient to grab the entire set of elements via $('.event-phase') and > comparing their "rel" attribute than it is to throw a loop around $ > ('.event-phase-' + i); > > I use ref/re

[jQuery] How to go to top of page after form validation fails (using jQuery validation plugin)

2009-03-31 Thread Kathryn
I'm using the validation plugin at http://bassistance.de. When form validation fails, focus goes to the first invalid element. But I have a summary error message at the top of the page which I want the user to see. If the first invalid field is too far down, they don't see the message. How can I g

[jQuery] Re: distinguishing between clicks on an outer container vs an "inner link"

2009-03-31 Thread mkmanning
Get rid of the anchor (it's not valid anyway), and you don't need to bind two click functions; your event delegation is fine--almost: You need to wrap the event with $() to use the attr() method. $("#row33").click( function(e) { if( $(e.target).attr("id") == "innerX) { ; // do inner l

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread Jonathan
That approach is only more efficient because the original design was lacking. Also, you can just use the starts(^) attribute selector $("div [id^='event-phase']") to retrieve all IDs that start with 'event-phase'. You don't get to make up new meaning for existing attributes because you think it s

[jQuery] Re: $.fadeTo() vs. MSIE6 through 8

2009-03-31 Thread Nekura Neko
Okay, nevermind, got it. The lines: // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level elem.zoom = 1; are referring to the .hasLayout property of element

[jQuery] Re: How to use in an IFrame?

2009-03-31 Thread Jonathan
Don't use IFrames, try and redesign your page to just use AJAX and load the response into a div instead. If for whatever reason you are locked into an IFrame you would need to include a script tag for jQuery in the IFrame in order to use jQuery since it's basically a new page within your page.

[jQuery] Re: distinguishing between clicks on an outer container vs an "inner link"

2009-03-31 Thread Blaine
Hey James, Your anchor tag for the table row is not needed. Simply add the id to the table row. $( document ).ready( function(){ var allowClick = 1; $("#row33").bind("click", function(e) { if (allowClick){ alert( "outer" ); } }); $("#innerXX").bind( "click",

[jQuery] [validate] Validating a date

2009-03-31 Thread Erich93063
I am using the jquery validate plugin and using the "date" validation, but it doesn't seem to be working right. If I enter "dfsdfs" I will get "Please enter a valid date", but if I enter "65/65/6565" which obvisouly is NOT a valid date, it will pass the validation just fine. ???

[jQuery] Re: A general Javascript question: duplicate IDs in a document?

2009-03-31 Thread Eric Garside
Right, but the problems with that approach is inefficiency. It's more efficient to grab the entire set of elements via $('.event-phase') and comparing their "rel" attribute than it is to throw a loop around $ ('.event-phase-' + i); I use ref/rel for the same basic semantic ideas behind their ascr

[jQuery] Re: JQuery variable usage with single/double quote problem

2009-03-31 Thread LinkGuru
Apologies. A couple of silly errors. 1) its dllViewSelector not ddlViewSelector (I do cut and paste a lot to save such mistakes, normally - honest). And (thanks James), there was a missing underscore. Thanks for all the other contributions to this including Michael Geary's sensible advice. It's th

[jQuery] distinguishing between clicks on an outer container vs an "inner link"

2009-03-31 Thread james.kirin40
Hi everyone! A brief question from a newbie. I have a table row which I want to be clickable, but I have a specific link within one cell. Something like: inner link! I want to have the clicks on the inner link call a certain function (eg, innerClick), while clicks on any oth

[jQuery] Re: jQuery BlockUI Plugin v2, problems overriding default messages /getting them to show

2009-03-31 Thread Mike Alsup
> I'm using BlockUI 1.33 and JQuery 1.2.3 That's the problem. 'message' is a 2.0+ option. If you need to use the old version of blockUI, consult the old docs: http://www.malsup.com/jquery/block/index-old.html

[jQuery] Superfish jQery menu dividers

2009-03-31 Thread Janno
Hello! We are using Superfish v1.4.8 jQuery plugin to display horizontal dropdown menu on my companys website. We would like to extend Superfish functionality and use dividers to separate first level menu items. It can be done using left and right border, but not in case if you would like to use

[jQuery] jQuery BlockUI Plugin v2, problems overriding default messages /getting them to show

2009-03-31 Thread javahollic
Hi, I'm looking at using this plugin to put up a blocking 'please wait' indicator during form submission in Confluence, however, the defaults always seem to apply, changing the defaults ($.blockUI.default.message='my custom message') or providing my own map of values, (eg including (message : 'my

[jQuery] Calendar App recommendations?

2009-03-31 Thread kozEfx
Looking for a jquery calendar app. Main requirements include Month/Day/Event views; Add/Delete Event, with date/time ranges; Next/Previous functionality for Month/Day/Event views; Database integration; source code available and extensible. Nice to have: Ajax enabled/integrated. Currently lookin

[jQuery] Firefox 3 (Win) bug in slide animation

2009-03-31 Thread ender
To see this bug in action, visit: http://www.keytosavannah.com and/or http://keytosavannah.dev.emarketsouth.com and click on one of the days in the calendar (top of the left column on most any page). A div will use the slide animation to display on top of the calendar with that day's events. Thi

[jQuery] jQuery Menu Show / Hide Question:

2009-03-31 Thread Slackzer
I have a listing of objects as links: [div: id="listing"] First Second Third [div: id="description"] [Object description goes here, initially hidden, contents displayed based upon which object is clicked above] [Upon click of new object, hide contents, if displayed, and then display new contents

[jQuery] selecting spans with an attribute of "for"

2009-03-31 Thread Captain Betty
Hi everyone. I have a weird issue with selecting spans with the “for” attribute. jQuery doesn’t seem to want to select it if the span is physically on the page. Physical test (fails): I have Some text here in on the page. My jQuery: $(“span[for=lid]”).css(“background”, “red”); Nothing happe

[jQuery] How to use in an IFrame?

2009-03-31 Thread wackyph...@yahoo.com
I have an IFrame that loads another page. But that page that is in the Iframe can't seem to use JQuery. Any ideas how I can do this? Thanks for any help.

[jQuery] will two JQuery libs conflicts?

2009-03-31 Thread Xu
Let say I have one web page that contains html/js snippets from another web site. If we both use JQuery. The two JQuery libs might be same version or might be different version. Will it cause conflicts? If so, how to avoid it? Will jQuery.noConflict () help here?

[jQuery] Re: Modifying CSS classes with jQuery (or '.live()' for '.css')

2009-03-31 Thread cschams
Since you want the style to update when the color changes and when you add or modify elements, why not dynamically create tags in the document head and let the browser do the work? $('head').append('