jquery

Rails tutorial for the dumbest person in the world (me)?

It is very difficult for me to find Rails tutorials (or books are also great) for my requirements: Stupidity Ruby 1.9 or lastest 1.8 MySQL A Game (simple roll play) JQuery front Thanks you! ...

JQuery: how to check a radio button?

So if this qstring var is set then i need to check a certain radio button ive tried the following : $("#AcctRB").attr('checked', 'checked'); $('input[id=AcctRB]:eq(1)').attr('checked', 'checked'); which does not work. I might have a syntax error Here is the rb : <input type="radio" onclick="accountShow()" id="AcctRB" ru...

Is there a way to attach a Javascript object to a Select Option

When building up a list of options in a select list using Javascript I'd like to attach a Javascript object to that option that I could easily retrieve in the change event. So, while writing this question I wanted to provide some sample code and found a way to make this work; so I have a slight addition to the question. Is it bad to att...

jquery simplify statements

Hi there, Say I have the following, is there a way to chain them together, or simplify them in an way? var initialTab = $('#navigation li#red'); initialTab.siblings().removeClass('on').find('ul').fadeOut(1000); initialTab.addClass('on').find('ul').fadeIn(1000); Thanks ...

How can I load the attributes of a CSS class in a stylesheet directly into a hash using JavaScript or jQuery?

I want to load the key value pairs from a class, or id, in a CSS stylesheet into a JavaScript object in order to access the data. Note that I do NOT want to add that class to a DOM element (at least not directly) The only way I can see in JQuery is to create a dummy hidden element, add my class to it using $(“#dummy").addClass(“myclas...

Set input values according to children of the parent div

given series of DIVs w/unique ID as in: <div id="2988"> <div class="site">YaHoot.com</div> <div class="logo">/images/yahootLogo.jpg</div> //[and so on] <input type="button" value="YaHoot" onclick="javascript:processMe('2988');" /> </div> //[followed by bunches more divs repeating that structure] I'm trying to code a clic...

How to use toggle event with live?

I have the following code $(".reply").toggle ( function () { x1(); }, function () { x2(); } ); I need to use live, so new elements would also be bound. Is there some syntax to do it? Or will I need to implement a toggle on the click event? I am using jQuery 1.4.2. ...

Find element by style selector in jquery

Hello everyone, I am trying to find an element with a particular style and change its style to something else. Here is the html element <table style='width: 555px;'> <tr> <td>blablabla</td> </tr> </table> Now I am trying to find the table with width 555px and change it to 650px using jquery. $('table[style*=width:555px]').c...

Javascript keycodes

Hi Folks, I am facing is weird problem. I have an input field on my page which gets its feed from a barcode scanner which appends a carriage return at the end (keycode: 13). When I use my scanner on a regular notepad, Once the input prints on screen, the cursor moves to the next line (it gets the carriage return), where as if I ...

Grouping list items (LIs) to OLs/ULs using jQuery

Is it possible, using Javascript and either jQuery or regular expressions, to group multiple sibling list items in HTML as in the example below? I need to convert TikiWiki markup to HTML, and it uses ungrouped lists (just adjacent lines appended with #). <li>Item 1.1</li> <li>Item 1.2</li> <li>Item 1.3</li> <p>Paragraph</p> <li>Item 2.1...

Get all the images within a class call post with jquery

Hi I just discovered jquery, but can't figure out how i can get all the imgs within a class and add a rel tag and set its title. I understood that class can be added like this: <script type='text/javascript'> $(document).ready(function() { $('.entry-content img').addClass('myClass yourClass'); }); </script> But is ...

How to respond to a specific keyword typed in a form input box using jQuery

I want to have a form with an input text field and be able to respond (display an alert text box) if the user types in the word 'hello' (case insensitive match). What event do I need to trap (the text input field does not seem to have a change event. This is what I have so far: <html> <head> <title>Some test</title> <sc...

Hide option elements in select dropdown and IE6

I wrote some jQuery code to .hide() an <option> element in a select dropdown. .hide() is what I want, because later I can call .show() and the options will not need to be resorted, since the now visible option element will not have changed positions. .hide() worked great in FF/Chrome, but not in IE6/7/8. So my thought was to write mor...

using jquery to slide down to a hash position

My homepage has a series of links. When those links are clicked, I want the user to be brought to a certain area of the clicked page. Typically I would use the following HTML on the homepage: <a href="products.html#link1">LINK</a> Where #link1 is the div I want to scroll to. This time, I want to use jquery to give it a nice elegant sc...

jquery plugin extend defaults problem

Hi everyone this is my first post so I hope I am posting to the right place. I am trying to develop a dialog/modal plugin. this is my first plugin and I'm not sure if I have produced it in the correct way. The problem I am having is that the $.extend is not updating the settings object. I've got 2 elements using the plugin. the #dialog...

Passing an array of objects from jQuery to ASP.NET Webmethod() returns error

I have a javascript class that's as below function paramObj(test_id,uid,qid,ai) { this.test_id = test_id; this.uid = uid; this.question_id = qid; this.ansIndex = ai; } I fill an array with several of these objects and send them to my ASP.NET C# WebMethod defined as [WebMethod()] [System.Web.Script.Services.Sc...

How to ajaxify a form which was loded through ajax

I am using jQuery form plugin and it is working great. Now I am loading a form using ajax. On success callback I have code something like this success: function(data) { $('#container').prepend(data); ajaxify_form(); } var ajaxify_form = function() { $('.new_form').ajaxForm(options); }; I need to do all that because I could no...

How to load data on a text field?

I have two text fields and whenever I write a number in the first one, it should give me its name on the second field. Let's say I write 11 on the "first" field, then it should automatically put the word 'eleven' (NOT number itself) on the "second" field. And the same thing with any number. I know this can be done with jQuery but I jus...

How to find item in array using jQuery?

So I have this array: var statuses = { New:1, Addressed:2, Rejected:3, Recovered:4, Billed:5, Completed:6 }; And I'd like to basically search the array for the "Rejected" key and have it return the value, so I can then go back/forth in the array as needed. I've tried this, but it always fails with a "-1" saying it can't find it. jQu...

jqGrid sort icon manipulation

How can you toggle the sort icons on/off? From another post I saw this seems to turn them off: $("#gbox_list .s-ico span").hide(). But this corresponding code did NOT seem to turn them on again: $("#gbox_list .s-ico span").show(). ?? And how can you manipulate them? Ie: How can you programatically set the second column to show the a...