[jQuery] Re: How to find the index of the parent of a specific element

2009-05-14 Thread Abdullah Rubiyath
Hi there, You could the following a try: $(document).ready(function() { var index = $(#mymenu ul li).index( $(li:has(#link_y)) ); // index will store the 'index' of li tag that has id=link_y }); Hope this helps, Thanks, Abdullah. On May 14, 8:31 am, Jo jo.arg...@gmail.com wrote: My

[jQuery] Re: Newbie Question... Appending multiple items, with the same span name

2009-05-13 Thread Abdullah Rubiyath
Hey there, You could try the following: $(document).ready(function() { $(ul li).each(function() { var thisName = $('.name', this).text(); // get the content inside '.name' class of this element $(this).append('span class=additionala href=addinfo.php'+ thisName +'s additional Info/a/span

[jQuery] Re: hide parent div according to span containing some text

2009-04-04 Thread Abdullah Rubiyath
Hi There, If I am not mistaken, 'contains' is a selector not a method. http://docs.jquery.com/Selectors/contains You could try with the following: $(span.total:contains('1)).parent().hide(); OR, if you decide to place it in If-else block, then do the following: if

[jQuery] Re: Problem validating checkbox before allowing submit of form

2009-04-03 Thread Abdullah Rubiyath
Hi there, A few things to consider.. From your HTML form code: change this: input type=checkbox name=attributes[accept-t-and-c] id=accept-t- and-c value=yes CHECKED / to: input type=checkbox name=attributes[accept-t-and-c] id=accept-t- and-c value=yes checked=checked / From you JS Code:

[jQuery] Re: Get text of external HTML and encode

2009-04-03 Thread Abdullah Rubiyath
Hi There, If I am getting this right.. you are trying to get the contents of another file and inject it into an element, but ensuring it shows as plain text and javascripts are not executed. Can you try replacing $('#thisDiv').load with a $.get request and do the following:

[jQuery] Re: passing variables to a Jquery function

2009-03-31 Thread Abdullah Rubiyath
Hi, I believe you can use the following approach: Since you are requesting to another page, you can use the server-side script (PHP) to return the id, type, and success message in JSON format and then use them from jQuery, and instead of $.get, you can use $.getJSON or $.ajax, Using this

[jQuery] Re: post form using jquery ajax

2009-03-29 Thread Abdullah Rubiyath
Hi, I believe you can post form either using $.post or $.ajax method and there's a function called serialize( ), which serializes form data, instead of typing it's data in key value pairs manually. Serialize: http://docs.jquery.com/Ajax/serialize $.post and $.ajax: