Search Results

Search found 19279 results on 772 pages for 'jquery validate'.

Page 9/772 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Getting value from href using jQuery

    - by bateman_ap
    Hi, I wonder if anyone can help with a jQuery problem I am having. I am using the tooltips from the Jquery Tools library to create a popup window when mousing over an hrefed image, this I want to use to cusomise the call to change the content in the DIV. The links I am using are in the form: <a href="/venue/1313.htm" class="quickView"><img src="/images/site/quickView83.png" alt="Quick View" width="83" height="20" /></a> The code I am using to trigger the tip is: $(".quickView").live('mouseover', function() { if (!$(this).data('init')) { $(this).data('init', true); ajax_quickView(); $(this).tooltip ({ /* tooltip configuration goes here */ tip: "#quickViewWindow", position: "right", offset: [0, -300], effect: 'slide' }); $(this).trigger('mouseover'); } }); I have tried the following function to grab the ID (in the example above, 1313) from the link: function ajax_quickView(){ var pageNum = $("a.quickView").attr("href").match(/venue/([0-9]+)/).htm[1]; $("#quickViewWindow").load("/quick-view/", function(){}) } However I think this is where it falls down, I think my regex is prob to blame... Once I get the var pageNum I presume I can just pass it into the .load as: $("#quickViewWindow").load("/quick-view/", {id : pageNum }, function(){}) Many thanks

    Read the article

  • How to use JQUERY to filter table rows dynamically using multiple form inputs

    - by tresstylez
    I'm displaying a table with multiple rows and columns. I'm using a JQUERY plugin called uiTableFilter which uses a text field input and filters (shows/hides) the table rows based on the input you provide. All you do is specify a column you want to filter on, and it will display only rows that have the text field input in that column. Simple and works fine. I want to add a SECOND text input field that will help me narrow the results down even further. So, for instance if I had a PETS table and one column was petType and one was petColor -- I could type in CAT into the first text field, to show ALL cats, and then in the 2nd text field, I could type black, and the resulting table would display only rows where BLACK CATS were found. Basically, a subset. Here is the JQUERY I'm using: $("#typeFilter").live('keyup', function() { if ($(this).val().length > 2 || $(this).val().length == 0) { var newTable = $('#pets'); $.uiTableFilter( theTable, this.value, "petType" ); } }) // end typefilter $("#colorFilter").live('keyup', function() { if ($(this).val().length > 2 || $(this).val().length == 0) { var newTable = $('#pets'); $.uiTableFilter( newTable, this.value, "petColor" ); } }) // end colorfilter Problem is, I can use one filter, and it will display the correct subset of table rows, but when I provide input for the other filter, it doesn't seem to recognize the visible table rows that are remaining from the previous column, but instead it appears that it does an entirely new filtering of the original table. If 10 rows are returned after applying one filter, the 2nd filter should only apply to THOSE 10 rows. I've tried LIVE and BIND, but not working. Can anyone shed some light on where I'm going wrong? Thanks!

    Read the article

  • How to submit the form using JQuery UI?

    - by Vafello
    I have a form in html with a default submit button. After the form is submitted, a php file is run (with action = homelocation). I decided to use JQuery UI dialog to display the form. I have 2 default buttons there - one to save and one to close the dialog. Can anyone tell me how to assign the form submit button action to the JQuery dialog button(i.e. replace the submit button from the form with the one in the dialog)? Here's my code: <div id="userdialog" title="Add"> <form id="add" action="engine.php" method="POST"> <input type="hidden" name="action" value="homelocation" id="action"> <button type="submit">Save this location</button> </form></div> Dialog: $('#userdialog').dialog({ width: 260, position: [250,100], buttons: { "Save": function() { HERE GOES THE REQUIRED FUNCTION $(this).dialog('close'); }, "Don't Save": function() { $(this).dialog("close"); } } });

    Read the article

  • Best method to select an object from another unknown jQuery object

    - by Yosi
    Lets say I have a jQuery object/collection stored in a variable named obj, which should contain a DOM element with an id named target. I don't know in advance if target will be a child in obj, i.e.: obj = $('<div id="parent"><div id="target"></div></div>'); or if obj equals target, i.e.: obj = $('<div id="target"></div>'); or if target is a top-level element inside obj, i.e.: obj = $('<div id="target"/><span id="other"/>'); I need a way to select target from obj, but I don't know in advance when to use .find and when to use .filter. What would be the fastest and/or most concise method of extracting target from obj? What I've come up with is: var $target = obj.find("#target").add(obj.filter("#target")); UPDATE I'm adding solutions to a JSPERF test page to see which one is the best. Currently my solution is still the fastest. Here is the link, please run the tests so that we'll have more data: http://jsperf.com/jquery-selecting-objects

    Read the article

  • Ajax call in a jQuery plugin not working properly

    - by Saneef
    I'm trying to create a jQuery plugin, inside I need to do an AJAX call to load an xml. jQuery.fn.imagetags = function(options) { s = jQuery.extend({ height:null, width:null, url:false, callback:null, title:null, }, options); return this.each(function(){ obj = $(this); //Initialising the placeholder $holder = $('<div />') .width(s.width).height(s.height) .addClass('jimageholder') .css({ position: 'relative', }); obj.wrap($holder); $.ajax({ type: "GET", url: s.url, dataType: "xml", success:function(data){ initGrids(obj,data,s.callback,s.title); } , error: function(data) { alert("Error loading Grid data."); }, }); function initGrids(obj, data,callback,gridtitle){ if (!data) { alert("Error loading Grid data"); } $("gridlist gridset",data).each(function(){ var gridsetname = $(this).children("setname").text(); var gridsetcolor = ""; if ($(this).children("color").text() != "") { gridsetcolor = $(this).children("color").text(); } $(this).children("grid").each(function(){ var gridcolor = gridsetcolor; //This colour will override colour set for the grid set if ($(this).children("color").text() != "") { gridcolor = $(this).children("color").text(); } //addGrid(gridsetname,id,x,y,height,width) addGrid( obj, gridsetname, $(this).children("id").text(), $(this).children("x").text(), $(this).children("y").text(), $(this).children("height").text(), $(this).children("width").text(), gridcolor, gridtitle ); }); }); } function addGrid(obj,gridsetname,id,x,y,height,width,color,gridtitle){ //To compensate for the 2px border height-=4; width-=4; $grid = $('<div />') .addClass(gridsetname) .attr("id",id) .addClass('gridtag') .imagetagsResetHighlight() .css({ "bottom":y+"px", "left":x+"px", "height":height+"px", "width":width+"px", }); if(gridtitle != null){ $grid.attr("title",gridtitle); } if(color != ""){ $grid.css({ "border-color":color, }); } obj.after($grid); } }); } The above plugin I bind with 2 DOM objects and loads two seperate XML files but the callback function is run only on the last DOM object using both loaded XML files. How can I fix this, so that the callback is applied on the corresponding DOMs. Is the above ajax call is correct? Sample usage: <script type="text/javascript"> $(function(){ $(".romeo img").imagetags({ height:500, width:497, url: "sample-data.xml", title: "Testing...", callback:function(id){ console.log(id); }, }); }); </script> <div class="padding-10 min-item background-color-black"> <div class="romeo"><img src="images/samplecontent/test_500x497.gif" alt="Image"> </div> </div> <script type="text/javascript"> $(function(){ $(".romeo2 img").imagetags({ height:500, width:497, url: "sample-data2.xml", title: "Testing...", callback:function(id){ console.log(id); }, }); }); </script> <div class="padding-10 min-item background-color-black"> <div class="romeo2"><img src="images/samplecontent/test2_500x497.gif" alt="Image"> </div> </div> Here is the sample XML data: <?xml version="1.0" encoding="utf-8"?> <gridlist> <gridset> <setname>gridset4</setname> <color>#00FF00</color> <grid> <color>#FF77FF</color> <id>grid2-324</id> <x>300</x> <y>300</y> <height>60</height> <width>60</width> </grid> </gridset> <gridset> <setname>gridset3</setname> <color>#00FF00</color> <grid> <color>#FF77FF</color> <id>grid2-212</id> <x>300</x> <y>300</y> <height>100</height> <width>100</width> </grid> <grid> <color>#FF77FF</color> <id>grid2-1212</id> <x>200</x> <y>10</y> <height>200</height> <width>10</width> </grid> </gridset> </gridlist>

    Read the article

  • validate() > show field after radiobutton selection

    - by RihanU
    hi im saw this jquery script: http://jquery.bassistance.de/validate/demo/ and i want also the posibility to show a field when a button is checked but not with a checkbox. but with two radiobuttons. if radiobutton1 is checked, display field1 and if radiobutton2 is checked display field 2 what do i have to change..? <script type="text/javascript"> $().ready(function() { //code to hide topic selection, disable for demo var foo = $("#foo"); // foo topics are optional, hide first var inital = foo.is(":checked"); var topics = $("#blaat")[inital ? "removeClass" : "addClass"]("gray"); var topicInputs = topics.find("input").attr("disabled", !inital); // show when foo is checked foo.click(function() { topics[this.checked ? "removeClass" : "addClass"]("gray"); topicInputs.attr("disabled", !this.checked); }); }); </script> <form class="cmxform" id="signupForm" method="get" action=""> <fieldset> <p> <label for="foo">De checkbox dus veranderen naar 2 radio buttons</label> <input type="checkbox" class="checkbox" id="foo" name="foo" /> <!-- <input type="radio" value="ding" class="checkbox" id="foo" name="foo" /> <input type="radio" value="dong" class="checkbox" id="foo" name="foo" /> --> </p> <!-- Fieldset 1 --> <fieldset id="blaat"> <label for="topic_marketflash"> <input type="checkbox" id="topic_marketflash" value="marketflash" name="topic" /> Marketflash </label> <label for="topic_fuzz"> <input type="checkbox" id="topic_fuzz" value="fuzz" name="topic" /> Latest fuzz </label> <label for="topic_digester"> <input type="checkbox" id="topic_digester" value="digester" name="topic" /> Mailing list digester </label> </fieldset> <!-- --> <!-- Fieldset 2 --> <fieldset id="andere"> <label for="topic_marketflash"> <input type="checkbox" id="topic_marketflash" value="marketflash" name="topic" /> Voor </label> <label for="topic_fuzz"> <input type="checkbox" id="topic_fuzz" value="fuzz" name="topic" /> Beelden </label> </fieldset> <!-- --> </fieldset> </form>

    Read the article

  • jQuery 1.4 Opacity and IE Filters

    - by Rick Strahl
    Ran into a small problem today with my client side jQuery library after switching to jQuery 1.4. I ran into a problem with a shadow plugin that I use to provide drop shadows for absolute elements – for Mozilla WebKit browsers the –moz-box-shadow and –webkit-box-shadow CSS attributes are used but for IE a manual element is created to provide the shadow that underlays the original element along with a blur filter to provide the fuzziness in the shadow. Some of the key pieces are: var vis = el.is(":visible"); if (!vis) el.show(); // must be visible to get .position var pos = el.position(); if (typeof shEl.style.filter == "string") sh.css("filter", 'progid:DXImageTransform.Microsoft.Blur(makeShadow=true, pixelradius=3, shadowOpacity=' + opt.opacity.toString() + ')'); sh.show() .css({ position: "absolute", width: el.outerWidth(), height: el.outerHeight(), opacity: opt.opacity, background: opt.color, left: pos.left + opt.offset, top: pos.top + opt.offset }); This has always worked in previous versions of jQuery, but with 1.4 the original filter no longer works. It appears that applying the opacity after the original filter wipes out the original filter. IOW, the opacity filter is not applied incrementally, but absolutely which is a real bummer. Luckily the workaround is relatively easy by just switching the order in which the opacity and filter are applied. If I apply the blur after the opacity I get my correct behavior back with both opacity: sh.show() .css({ position: "absolute", width: el.outerWidth(), height: el.outerHeight(), opacity: opt.opacity, background: opt.color, left: pos.left + opt.offset, top: pos.top + opt.offset }); if (typeof shEl.style.filter == "string") sh.css("filter", 'progid:DXImageTransform.Microsoft.Blur(makeShadow=true, pixelradius=3, shadowOpacity=' + opt.opacity.toString() + ')'); While this works this still causes problems in other areas where opacity is implicitly set in code such as for fade operations or in the case of my shadow component the style/property watcher that keeps the shadow and main object linked. Both of these may set the opacity explicitly and that is still broken as it will effectively kill the blur filter. This seems like a really strange design decision by the jQuery team, since clearly the jquery css function does the right thing for setting filters. Internally however, the opacity setting doesn’t use .css instead hardcoding the filter which given jQuery’s usual flexibility and smart code seems really inappropriate. The following is from jQuery.js 1.4: var style = elem.style || elem, set = value !== undefined; // IE uses filters for opacity if ( !jQuery.support.opacity && name === "opacity" ) { if ( set ) { // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // Set the alpha filter to set the opacity var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"; var filter = style.filter || jQuery.curCSS( elem, "filter" ) || ""; style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity; } return style.filter && style.filter.indexOf("opacity=") >= 0 ? (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "": ""; } You can see here that the style is explicitly set in code rather than relying on $.css() to assign the value resulting in the old filter getting wiped out. jQuery 1.32 looks a little different: // IE uses filters for opacity if ( !jQuery.support.opacity && name == "opacity" ) { if ( set ) { // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level elem.zoom = 1; // Set the alpha filter to set the opacity elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) + (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); } return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': ""; } Offhand I’m not sure why the latter works better since it too is assigning the filter. However, when checking with the IE script debugger I can see that there are actually a couple of filter tags assigned when using jQuery 1.32 but only one when I use jQuery 1.4. Note also that the jQuery 1.3 compatibility plugin for jQUery 1.4 doesn’t address this issue either. Resources ww.jquery.js (shadow plug-in $.fn.shadow) © Rick Strahl, West Wind Technologies, 2005-2010Posted in jQuery  

    Read the article

  • jquery validate: focusCleanup: true and focusInvalid: false don't work as expected

    - by laramichaels
    I am using Joern's jquery validation plugin 1.6. My goal is to have the following behavior: remove the error message for an element once the user focuses it. From what I understand setting 'focusCleanup: true' should take care of this. However (at least on my browser (Firefox 3.5.7 on Linux)), I only get the desired behavior (ie, error message for a field disappearing once you focus it) if I click into the field; it doesn't handle tabbing into the field correctly. Sample code: HTML: <form id='abc' name='abc'> <input type="text" id="t1" name="t1"/> <input type="text" id="t2" name="t2"/> <input type="submit" id="submit" value='submit'/> </form> JS: $("#abc").validate({ focusCleanup: true, focusInvalid: false, rules: {t1: {required: true, email:true}, t2: {required: true,email:true}} }); I am setting 'focusInvalid: false' because the docs say one should avoid combining focusCleanup and focusInvalid; in my experience commenting out that line makes no difference. Am I doing something wrong?

    Read the article

  • Zendx JQuery Autocomplete

    - by emeraldjava
    I've been trying to get the Zend Jquery autocomplete function working, when i noticed this section in the Zend documentation. The following UI widgets are available as form view helpers. Make sure you use the correct version of jQuery UI library to be able to use them. The Google CDN only offers jQuery UI up to version 1.5.2. Some other components are only available from jQuery UI SVN, since they have been removed from the announced 1.6 release. autoComplete($id, $value, $params, $attribs): The AutoComplete View helper will be included in a future jQuery UI version (currently only via jQuery SVN) and creates a text field and registeres it to have auto complete functionality. The completion data source has to be given as jQuery related parameters 'url' or 'data' as described in the jQuery UI manual. Does anybody know which svn url tag or branch i need to download to get a javascript file with the autocomplete functions available in it? At the moment, my Bootstrap.php has $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); $view->jQuery()->enable(); $view->jQuery()->uiEnable(); Zend_Controller_Action_HelperBroker::addHelper( new ZendX_JQuery_Controller_Action_Helper_AutoComplete() ); // Add it to the ViewRenderer $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); $viewRenderer->setView($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); In my layout, i define the jquery ui version i want <?php echo $this->jQuery() ->setUiVersion('1.7.2');?> Finally my index.phtml has the autocomplete widget <p><?php $data = array('New York', 'Tokyo', 'Berlin', 'London', 'Sydney', 'Bern', 'Boston', 'Baltimore'); ?> <?php echo $this->autocomplete("ac1", "", array('data' => $data));?></p> I'm using Zend 1.8.3 atm.

    Read the article

  • jQuery AutoComplete select firing after change?

    - by Zarigani
    I'm using the jQuery UI AutoComplete control (just updated to jQuery UI 1.8.1). Whenever the user leaves the text box, I want to set the contents of the text box to a known-good value and set a hidden ID field for the value that was selected. Additionally, I want the page to post back when the contents of the text box are changed. Currently, I am implementing this by having the autocomplete select event set the hidden id and then a change event on the text box which sets the textbox value and, if necessary, causes a post back. If the user just uses the keyboard, this works perfectly. You can type, use the up and down arrows to select a value and then tab to exit. The select event fires, the id is set and then the change event fires and the page posts back. If the user starts typing and then uses the mouse to pick from the autocomplete options though, the change event fires (as focus shifts to the autocomplete menu?) and the page posts back before the select event has a chance to set the ID. Is there a way to get the change event to not fire until after the select event, even when a mouse is used? $(function() { var txtAutoComp_cache = {}; var txtAutoComp_current = { label: $('#txtAutoComp').val(), id: $('#hiddenAutoComp_ID').val() }; $('#txtAutoComp').change(function() { if (this.value == '') { txtAutoComp_current = null; } if (txtAutoComp_current) { this.value = txtAutoComp_current.label ? txtAutoComp_current.label : txtAutoComp_current; $('#hiddenAutoComp_ID').val(txtAutoComp_current.id ? txtAutoComp_current.id : txtAutoComp_current); } else { this.value = ''; $('#hiddenAutoComp_ID').val(''); } // Postback goes here }); $('#txtAutoComp').autocomplete({ source: function(request, response) { var jsonReq = '{ "prefixText": "' + request.term.replace('\\', '\\\\').replace('"', '\\"') + '", "count": 0 }'; if (txtAutoComp_cache.req == jsonReq && txtAutoComp_cache.content) { response(txtAutoComp_cache.content); return; } $.ajax({ url: 'ajaxLookup.asmx/CatLookup', contentType: 'application/json; charset=utf-8', dataType: 'json', data: jsonReq, type: 'POST', success: function(data) { txtAutoComp_cache.req = jsonReq; txtAutoComp_cache.content = data.d; response(data.d); if (data.d && data.d[0]) { txtAutoComp_current = data.d[0]; } } }); }, select: function(event, ui) { if (ui.item) { txtAutoComp_current = ui.item; } $('#hiddenAutoComp_ID').val(ui.item ? ui.item.id : ''); } }); });

    Read the article

  • jQuery UI Tabs animation

    - by Ayrton
    Hi I haven't been able to find a lot of documentation on animating the jQuery UI Tabs, so I'm wondering if anyone knows how to simulate a grow/shrink effect relatively to the current tab I don't really like the height: 'toggle' animation where the tab goes to height 0px first and then the height of the new tab. when tab 1 has a height of 100px and the second a height of 120px I would like the tab to grow 20px

    Read the article

  • Firefox crashes with mulitple Uploadify JQuery browse buttons and ajax

    - by droidy
    Hi, I'm using four JQuery Uploadify browse buttons on a page that's calling the Uploadify code/buttons through Ajax. We have a javascript function called from onComplete which refreshes the Ajax page. The problem we're encountering is that when you start uploading one file, if you click browse to upload another file, Firefox will crash when selecting the second file. Any help is appreciated. Thanks!

    Read the article

  • Display issue with jQuery dialog: form shows as separate window

    - by RememberME
    On my button click, the jQuery dialog appears with just the title and buttons. When you mouseover, then you see the form inputs in front of the dialog covering the buttons. When you scroll down, the form inputs do not move, so you can never see the last few textboxes. <div id="popupCreateCompany" title="Create a new company"> <form> <fieldset> <p> <label for="company_name">Company Name:</label> <%= Html.TextBox("company_name") %> </p> <p> <label for="company_desc">Company Description:</label> <%= Html.TextBox("company_desc") %> </p> <p> <label for="address">Address:</label> <%= Html.TextBox("address") %> </p> <p> <label for="city">City:</label> <%= Html.TextBox("city") %> </p> <p> <label for="state">State:</label> <%= Html.TextBox("state") %> </p> <p> <label for="zip">Zip:</label> <%= Html.TextBox("zip") %> </p> <p> <label for="website">Website:</label> <%= Html.TextBox("website") %> </p> </fieldset> </form> </div> jQuery: <script type="text/javascript"> $(document).ready(function() { $('input').filter('.datepick').datepicker(); $('#popupCreateCompany').dialog( { autoOpen: false, modal: true, buttons: { 'Add': function() { var dialog = $(this); var form = dialog.find('input:text'); $.post('/company/create', $(form).serialize(), function() { dialog.dialog('close'); }) }, 'Cancel': function() { $(this).dialog('close'); } } }); $("#create-company").click(function() { $('#popupCreateCompany').dialog('open'); }); On mouseover: After scroll down:

    Read the article

  • adding jquery validation after form created

    - by CoffeeCode
    im using a jquery validation plugin first i add the validation to the form: $('#EmployeeForm').validate({ rules: { "Employee.FirstName": "required", "Employee.PatronymicName": "required", "Employee.LastName": "required", "Employee.BirthDay": { required: true, date: true } }, messages: { "Employee.FirstName": { required: "*" }, "Employee.PatronymicName": { required: "*" }, "Employee.LastName": { required: "*" }, "Employee.BirthDay": { required: "*", date: "00.00.00 format" } } }); and then latter a need to add validation rules to other form elements: $('#Address_A.Phone1, #Address_A.Phone2, #Address_B.Phone1, #Address_B.Phone2').rules("add", { digits: true, messages: { digits: "?????? ?????" } }); but i get an error: 'form' is null or not an object i check, the form and all the elements in it are created before i add validation to it. cant figer out whats wrong.

    Read the article

  • Accessible semantic jQuery tabs plugin

    - by user249950
    Hello, Just a quick question to see if anyone knows of any jquery tabs plugins that run based on a similar structure to: <div class="tabs"> <div> <h4>Tab one</h4> <p>Lorem Ipsum</p> </div> <div> <h4>Tab two</h4> <p>Lorem Ipsum</p> </div> </div> Where the plugin grabs the title of the tabs from the h4s? I can only seem to find plugins that use the structure: <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>Tab 1 content</p> </div> <div id="tabs-2"> <p>Tab 2 content</p> </div> <div id="tabs-3"> <p>Tab 3 content</p> </div> </div> I assume the only other way to use these plugins would be to grab the titles, remove them, add them into a list at the top of the html and then run the plugin based on that? I just ask as I am quite new to jQuery so I'm not sure how I would go about it and just wondered if there was a plugin already in existence that anyone knew of. If not, not to worry, I'll have to get busy with the docs and give it a go! Cheers

    Read the article

  • load google annotated chart within jquery ui tab content via ajax method

    - by twmulloy
    Hi, I am encountering an issue with trying to load a google annotated chart (http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html) within a jquery ui tab using content via ajax method (http://jqueryui.com/demos/tabs/#ajax). If instead I use the default tabs functionality, writing out the code things work fine: <div id="tabs"> <ul> <li><a href="#tabs-1">Chart</a></li> </ul> <div id="tabs-1"> <script type="text/javascript"> google.load('visualization', '1', {'packages':['annotatedtimeline']}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('date', 'Date'); data.addColumn('number', 'cloudofinc.com'); data.addColumn('string', 'header'); data.addColumn('string', 'text') data.addColumn('number', 'All Clients'); data.addRows([ [new Date('May 12, 2010'), 2, '2 New Users', '', 3], [new Date('May 13, 2010'), 0, undefined, undefined, 0], [new Date('May 14, 2010'), 0, undefined, undefined, 0], ]); var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_users')); chart.draw(data, { displayAnnotations: false, fill: 10, thickness: 1 }); } </script> <div id='chart_users' style='width: 100%; height: 400px;'></div> </div> </div> But if I use the ajax method for jquery ui tab and point to the partial for the tab, it doesn't work completely. The page renders and once the chart loads, the browser window goes white. However, you can see the tab partial flash just before the chart appears to finish rendering (the chart never actually displays). I have verified that the partial is indeed loading properly without the chart. <div id="tabs"> <ul> <li><a href="ajax/tabs-1">Chart</a></li> </ul> </div>

    Read the article

  • Cannot populate form with ajax and populate jquery plugin

    - by Azriel_
    I'm trying to populate a form with jquery's populate plugin, but using $.ajax The idea is to retrieve data from my database according to the id in the links (ex of link: get_result_edit.php?id=34), reformulate it to json, return it to my page and fill up the form up with the populate plugin. But somehow i cannot get it to work. Any ideas: here's the code: $('a').click(function(){ $('#updatediv').hide('slow'); $.ajax({ type: "GET", url: "get_result_edit.php", success: function(data) { var $response=$(data); $('#form1').populate($response); } }); $('#updatediv').fadeIn('slow'); return false; whilst the php file states as follow: <?php $conn = new mysqli('localhost', 'XXXX', 'XXXXX', 'XXXXX'); @$query = 'Select * FROM news WHERE id ="'.$_GET['id'].'"'; $stmt = $conn->query($query) or die ($mysql->error()); if ($stmt) { $results = $stmt->fetch_object(); // get database data $json = json_encode($results); // convert to JSON format echo $json; } ?> Now first thing is that the mysql returns a null in this way: is there something wrong with he declaration of the sql statement in the $_GET part? Second is that even if i put a specific record to bring up, populate doesn't populate. Update: I changed the populate library with the one called "PHP jQuery helper functions" and the difference is that finally it says something. finally i get an error saying NO SUCH ELEMENT AS i wen into the library to have a look and up comes the following function function populateFormElement(form, name, value) { // check that the named element exists in the form var name = name; // handle non-php naming var element = form[name]; if(element == undefined) { debug('No such element as ' + name); return false; } // debug options if(options.debug) { _populate.elements.push(element); } } Now looking at it one can see that it should print out also the name, but its not printing it out. so i'm guessing that retrieving the name form the json is not working correctly. Link is at http://www.ocdmonline.org/michael/edit%5Fnews.php with username: Testing and pass:test123 Any ideas?

    Read the article

  • Retrieve jquery-ui dialog's div

    - by Hikari
    When we apply $().dialog() in an object, jquery-ui puts it inside a <div class="ui-dialog ui-widget">, with a <div class="ui-dialog-titlebar ui-widget-header"> before it. After the creation of this dialog around the main object, how can we get that ui-dialog object so that we can execute other JavaScript commands in it? The best I could do was use .parent(".ui-dialog") in the main object, is there a better way to do it?

    Read the article

  • JQuery UI Autocomplete - disallow free text entry?

    - by JK
    Is it possible to disallow free text entry in the JQuery UI autocomplete widget? eg I only want the user to be allowed to select from the list of items that are presented in the autocomplete list, and dont want them to be able to write some random text. I didn't see anything in the demos/docs describing how to do this. http://jqueryui.com/demos/autocomplete/ I'm using autocomplete like this $('#selector').autocomplete({ source: url, minlength: 2, select: function (event, ui) { // etc }

    Read the article

  • how to find selected elements with Jquery UI selectable

    - by kevzettler
    Hi All, I am looking for info on the event and ui objects the jquery selectable events: "selecting", and "start" take as parameters. I cannot find this in the documentation and looping through the properties is no help. $('#content_td_account').selectable({ filter: 'li:not(".non_draggable")', selecting: function(event, ui) { } }); Specifically I want to find what elements are being selected and check them to see if their parent elements are the same or not. I assumed this would be in the ui object some where.

    Read the article

  • Custom Validation on jquery validate plugin, need to count element in a multiple select

    - by 0plus1
    I have a multiple select, and I need to force the user to choose maximum two options, nothing more. I'm trying this: jQuery.validator.addMethod("morethantwo", function(value, element) { var foo = []; $(element+' :selected').each(function(i, selected){ foo[i] = $(selected).text(); alert(foo[i]); }); return true; },"Max two options." ); The problem is that I get a: uncaught exception: Syntax error, unrecognized expression: [object HTMLSelectElement] error. While if I do this: $(element).each(function(i, selected){ foo[i] = $(selected).text(); alert(foo[i]); }); It works but I get all the options in the select. Why is that? Is this the correct road to walk? Are there better ways to do this kind of check? Thank you very much!

    Read the article

  • JQuery UI Tabs - "Loading..." message

    - by Balu
    All, I am using Jquery UI nested tabs. I was just wondering if there is any way to display an AJAX Spinner image next to the tab text, while the tab is loading. I do not want to change the tab text to "Loading..". Consider that when multiple tabs are loading at the same time or one after the other, the spinner image should be displayed next to each loading tab.. Any Suggestions? Thanks

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >