jquery

Select value of a RadioButton

I want to select a particular RadioButton based on its value <input id="RadioJ" type="radio" name="grp1" value="AAA" /> <input id="FaroK" type="radio" name="grp1" value="BBB" /> <input id="MartreLK" type="radio" name="grp1" value="CCC" /> Something like this: var radio = radio button whose value is BBB Another thing i am looking is...

cancel onclick event on the table using jquery

Hi, I added a jquery onclick eventhandler to the table as follows $('#tableid').bind('click', ClickHandler); function ClickHandler(event) { //here i am checking whether the cell that the user clicked is valid to enter data. //if not, I would like to cancel the event. e.preventDefault(); //this is not working. the cell that ...

Radio Button Visibility

On the click of a button, how can i make all the hidden radio buttons show up? Simplest way? ...

Resizable and dragable iframe in thickbox (drupal)

hi, I have made a block in its body I have added php code that is : $var = md5(time()); echo "http://maps.google.com/maps?q=http%3A//mysitename/sites/default/files/content.kml?q=" . $var . "&keepThis=true&TB_iframe=true&height=560&width=1024' class = 'thickbox'>View Works On a Map"; ?> the above code causes an iframe to open with thic...

jQuery: determine if a <li> contains a <ul>

I have some HTML code that contains nested <ul> elements and I need to add a class 'parent' to each <li> element that contains a child <ul>. There could be more than one element contained directly withing a single <li> (e.g <li><a>...</a><span>...</span><ul>...</ul></li>). All I need is to determine if a particular <li> contains a <ul> ...

jQuery escape characters - square brackets

Hello Does anyone know how to escape the square bracket character in jQuery? Try the following: $('#txtFirstname').addClass('test[someval]') then $('#txtFirstname').attr('class') you'll see the class is there. Now try $('#txtFirstname').hasClass('test[someval]') FAIL The only reason I can think of is the square brackets. An...

How will you load new javascript into DOM with jQuery?

In order to shorten the time to open the page, I'm thinking of load part of the scripts after the page is loaded. The standard is to append new scripts into <head> part,right? ...

Element is not defined jQuery $(element).remove()

Hello SO: I have this javascript that adds a form field, along with a link to remove that field: var fieldCount = 0; function addField() { var name = 'file' + fieldCount; var row = 'row' + fieldCount; var str = '<p id="' + row + '"><label for="' + name + '">File to upload: <input type="file" name="' + name + '" id="' + name...

Getting inputs to auto-complete/suggest when preventing default form behavior

Hi Guys, Interesting bug here that seems to be limited to IE and Webkit. I have a basic form setup: <div id="output">Form output is displayed here</div> <form id="myForm" action="#" method="post"> <input type="text" name="username" id="usernameInput" /> <input type="submit" value="Submit" /> </form> Now if I just submit the form thro...

How can we implement Paging using json, Need the records to be preloaded. Help

I am trying to implement paging in PHP, using Json. I need the data to be preloaded, before the user click next results. Please Give me some suggestions or some references. ...

jquery selector in variable

can someone explain why this jquery selector is not working, I've worked around the issue but for my sanity would like to know what I've got wrong I have a form with multiple textareas, each gets an id like f_id_DSC000001.JPG where the last part is a photograph number, the textarea has an onblur event that uses post to send its contents...

Safe way to make behavioral CSS trigger based on Javascript availability

I have been using this chunk of code to programmatically check if Javascript is available and use different behavioral CSS. If Javascript is disabled, it will only show a normal unordered list. If javascript is enabled, the list will be transformed after page load and then displayed to the user (avoiding the possible redraw/flicker of...

JQuery Ajax Tabs + Keeping State

Hi there, i've been stuck on a problem and can't seem to find any help for it.. I've tried my own code, searched for tutorials on the matter but nothing seems to hit the mark.. I am currently using JQuery UI tabs for an application. Each tab click is actually loading its contents using Ajax. I now need to expand the functionality and k...

Ajax upload script for multiple files, jQuery ASP.NET MVC

Hello SO: I am working on an upload script for an ASP.NET MVC application. I have an implementation that works with one file, but I would like to expand this to handle multiple uploads. Here is the original implementation: Upload View (yes I will be moving this jQuery code to its own file): <script type="text/javascript"> var fieldCo...

How can accomplish a dual div swap on rollover?

I am looking for advice on a way to accomplish this. Given the following: [Div A (contains an image)] [Div B (contains a horizontal list of 8 or so text links)] [Div C (contains text)] Upon rolling over any link in Div B, how can I have Div A and Div C swap their respective contents out to something different that corresponds to the co...

Jquery dialog box not positions center screen

I have a jquery dialog box that is mean't to position in the middle, however it seems slightly off center vertically. Here is the code: $(\'#add_box\').dialog({ autoOpen: true', width: 300, modal: true, resizable: false, bgiframe:true }); Any ideas why this won't center? ...

jQuery: Target all except ___?

I'm looking for a way to select all elements on a page, except those with a specified DOM location.. Here's an example of what I'd like to do: jQuery('*').except('.ignore').bind('click', function(e) { ... }); Is this possible in a "native jQuery" way? ...

Click Toggle with jQuery

I've used hover function where you do x on mouseover and y and mouseout, so I'm trying the same for click but it doesn't seem to work: $('.offer').click(function(){ $(this).find(':checkbox').attr('checked', true ); },function(){ $(this).find(':checkbox').attr('checked', false ); }); I want the checkbox to be checked when clicke...

Can't get div height when including javascript in Django template

I'm trying to use the flot plugin for jquery and it keeps on complaining that a div has a width/height of zero. I'm actually including the javascript for this in a Django template. So my template file looks like: <style> #graph { width: 100px; height: 100px; } </style> <script> $.plot(stuff) console.log($(#graph).width()) </...

Output results from a jquery ajax call

I'm calling a webservice using jquer's ajax method and it seems to work since the 'success' function is executed. I need to output the raw results returned, but when I use alerts, the messagebox shows the output as: event='' XMLHttpRequest=success ajaxOptions=undefined What am I doing wrong and how can I output the raw results? $.ajax(...