Search Results

Search found 18690 results on 748 pages for 'jquery cookie'.

Page 48/748 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • jQuery-Ui Ajax Tabs bug?

    - by vsync
    I have a JSON that returns from the server which tabs to build, so I init them in my JS like this: $('#tabs').tabs( 'ajaxOptions', { timeout: 20000, error: function(xhr, status, index, anchor){ console.log( status, index, anchor ); } }) .tabs('add', item.CategoryLink, item.CategoryName); Thing is, when I click a tab, and before it is done loading I click another tab, the previous request is aborted and never called again when I click that first one again! this is very bad, because it obviously didn't fetch the request, so what gives? I tried bypassing this by setting: .tabs({ cache: false }) but this is a bad thing to do, because I don't want to have a request each time again... it should be cachced if response was sent. using jquery-ui 1.8.1

    Read the article

  • How to get width of a div in pixels using JQuery (IE)

    - by Casidiablo
    Hello there. At first glance it sounds easy... when using JQuery one can use the .width() method to retrieve the width of an element. The problem comes when the DIV element does not have its size in pixels but in words like 'auto' or 'inherit'. When I do this it works nice in Firefox and Chrome even if the size is specified in words: alert($('#id_div').css('width')); // these two sentences does not It returns something like: 96px. But, IE returns the word 'auto'. I need to know the size it has in pixels because I have to do some calculations with that number... so, I've been wondering how to solve this problem. How can I solve this issue? Thanks for reading.

    Read the article

  • Enable Datepicker only when first field has a value

    - by Syed Abdul Rahman
    Right now, the End Date selection is disabled. I want to only enable this when a Start Date is selected. if( $('#datepicker1').val().length === 0) { $('#datepicker2').datepicker("disable"); } else { $('#datepicker2').datepicker("enable"); } This clearly does not work. If I insert value = 'random date' into my first input field, it works fine. I'm not too sure on how do this. Clearly not as easy as I had hoped. My other problem, or hope, is to disable the dates including and before the first selection. You know, pick Start Date, and every date before and said date for the next picker would be disabled. But that is a whole other problem.

    Read the article

  • jQuery Autocomplete fetch and parse data source with custom function, except not

    - by Ben Dauphinee
    So, I am working with the jQuery Autocomplete function, and am trying to write a custom data parser. Not sure what I am doing incorrectly, but it throws an error on trying to call the autocompleteSourceParse function, saying that req is not set. setURL("ajax/clients/ac"); function autocompleteSourceParse(req, add){ var suggestions = []; $.getJSON(getURL()+"/"+req, function(data){ $.each(data, function(i, val){ suggestions.push(val.name); }); add(suggestions); }); return(suggestions); } $("#company").autocomplete({ source: autocompleteSourceParse(req, add), minLength: 2 });

    Read the article

  • jQuery draggable leaving cloned html behind

    - by Alex Crooks
    I am using jQuery UI; Draggable http://jqueryui.com/demos/draggable invoked like this: $(document).ready(function(){ $("#side_bar").sortable({ revert: true }); $(".draggable").draggable({ containment: 'parent', hascroll: true, handle: 'div.box_header', scrollSensitivity: 100, scrollSpeed: 100, axis: 'y', connectToSortable: '#side_bar', helper: 'clone', opacity: 0.35 }); }); You can see the html structure on http://www.sarsclan.co.uk (right side bar area). It seems to create a transparant clone as your dragging, but when you drop it puts the draggable div in the right place, but leaves the original div in it's place and just appends the dom with a clone of that original div in its new place.

    Read the article

  • Test if element already has jQuery datepicker

    - by macca1
    I have a form with many input elements. Some are date fields with a jQuery UI datepicker alraedy attached: $("#someElement").mask("9?9/99/9999").datepicker({showOn: 'button', buttonText:'Click here to show calendar', duration: 'fast', buttonImageOnly: true, buttonImage: /images/calicon.gif' }); Then I have a key command bound to this function: function openCalendar() { var selection = document.activeElement; // { Need to test here if datepicker has already been initialized $(selection).datepicker("show"); // } } This works great for elements which already have the datepicker on them. However any other fields will throw a javascript error. I'm wondering the best way to test to see if datepicker has already been initialized on that field.

    Read the article

  • JQuery-tmpl Template Switching Not working.

    - by Mike
    I'm trying to implement "more/less" functionality using the official jquery-tmpl plugin. I've looked at the examples, but I cannot seem to get the functionality to work in my own implementation. When I click on one of my "More" buttons, I seem to get an error thrown of: Uncaught TypeError: Property 'tmpl' of object #<an Object> is not a function This is my implementation here From what I can tell, the example I'm trying to replace is doing the following: Render the "Master" template On-click: Find the corresponding template object (tmplItem) to the clicked element. Pass in reference to a new template. Call the update function to re-render. Have I understood the documentation wrong? From what I can tell I'm doing the same thing as the example on the official documentation.

    Read the article

  • table cell background color change problem

    - by Mellon
    I work on another guy's code, and I try to change the table cell background color when mouse over the cell, and change back to the original background color when mouse leave. I use the following code: var bgcolor=$(".cell-el").css("background-color") $(".cell-el").hover( function(){ $(this).css("background-color", "#3c3c36")}, //mouse enter, bg-color change function(){ $(this).css("background-color", bgcolor) // mouse leave, bg-color change back }) Things are working fine, EXCEPT that when mouse first time enter the cell, the cell background color is not changed to "#3c3c36", but when mouse leave the cell after first entering and enter in the cell again, the cell's background color changed to "#3c3c36". That's the cell color never change for mouse first enter, after that, everything is working great. What's could be the cause of this problem?

    Read the article

  • jQuery validation plugin doens't work for me

    - by Idsa
    I have the following code to enable validation work: $(document).ready(function() { $("#eventForm").validate({ rules: { startDate: "required", startTime: "required", endDate: { required: function (element) { var endTimeValue = $('#endTime').val(); return (endTimeValue != null && endTimeValue != ''); } }, endTime: { required: function (element) { var endDateValue = $('#endDate').val(); return (endDateValue != null && endDateValue != ''); } } }, messages: { startDate: "Please enter event local start date", startTime: "Please enter event local start time" }, errorPlacement: function (error, element) { error.appendTo(element.parent().next()); }, submitHandler: function (form) { var options = { dataType: 'json', success: eventCreationSuccess, error: eventCreationError }; alert('submit'); //$(form).ajaxSubmit(options); } }); }); But validation plugin doesn't catch submit - default submit is executed. jQuery and validation plugin scripts are imported.

    Read the article

  • Returning mySQL error with jQuery & AJAX

    - by kel
    I've got a form inserting data into mySQL. It works but I'm trying to add error handling in case something happens. If I break the Insert statements mySQL dies but I'm still getting a success message on the front end. What am I doing wrong? AJAX function postData(){ var employeeName = jQuery('#employeeName').val(); var hireDate = jQuery('#hireDate').val(); var position = jQuery('#position').val(); var location = jQuery('#location').val(); var interveiwer = jQuery('#interviewersID').val(); var q01 = jQuery('#q01').val(); var q02 = jQuery('#q02').val(); var q03 = jQuery('#q03').val(); var q04 = jQuery('#q04').val(); var q05 = jQuery('#q05').val(); var summary = jQuery('#summary').val(); jQuery.ajax({ type: 'POST', url: 'queryDay.php', data: 'employeeName='+ employeeName +'&hireDate='+ hireDate +'&position='+ position +'&location='+ location +'&interveiwer='+ interveiwer +'&q01='+ q01 +'&q02='+ q02 +'&q03='+ q03 +'&q04='+ q04 +'&q05='+ q05 +'&summary='+ summary, success: function(){ jQuery('#formSubmitted').show(); }, error: function(jqXHR, textStatus, errorThrown){ jQuery('#returnError').html(errorThrown); jQuery('#formError').show(); } }); }; PHP require_once 'config.php'; $employeeName = $_POST['employeeName']; $hireDate = $_POST['hireDate']; $position = $_POST['position']; $location = $_POST['location']; $interviewerID = $_POST['interveiwer']; $q01 = $_POST['q01']; $q02 = $_POST['q02']; $q03 = $_POST['q03']; $q04 = $_POST['q04']; $q05 = $_POST['q05']; $summary = $_POST['summary']; mysql_query("INSERT INTO employee (name, hiredate, position, location) VALUES ('$employeeName', '$hireDate', '$position', '$location')") or die (mysql_error()); $employeeID = mysql_insert_id(); mysql_query("INSERT INTO day (employee, interviewer, datetaken, q01, q02, q03, q04, q05, summary) VALUES ('$employeeID', '$interviewerID', NOW(), '$q01', '$q02', '$q03', '$q04', '$q05', '$summary')") or die (mysql_error());

    Read the article

  • jQuery Validation Engine with Mime

    - by Diego Pucci
    I have this custom rule with tje jQuery validation Engine: "validateMIME": { "func": function(field, rules, i, options){ var fileInput = field[0].files[0]; var MimeFilter = new RegExp(rules[3],'i'); if (fileInput) { return MimeFilter.test(fileInput.type); } else { return true;} }, "alertText": "* Estensione non supportata" }, The problem is that this is working ONLY if the field is required. But in my case the field is not required, but if filled then the Mime type needs to be checked. How do I edit this function to work with non required fields? what's wrong with it? Thanks

    Read the article

  • jQuery Address Plugin - Not allowing loading ajax?

    - by Nic Hubbard
    I am trying to test the jQuery Address Plugin and it seems to not allow ajax to work in the change function. I am using: $.address.change(function(event) { $('#content').load(event.value+' #content'); $.address.title(event.value); }); $('a').click(function() { $.address.value($(this).attr('href')); }); While I can use event.value for other things, it just does not seem to let the .load() function work. Even trying a static URL in .load() does nothing. Is something in the plugin preventing this? I thought this was the point of the plugin!

    Read the article

  • jQuery validate - how do I ignore letter case?

    - by Jamie
    Probably a goofy question, but I can't seem to find anything in google land. I simply need one of my methods to ignore the case of the entered field. I am doing a city name match, but need both "Atlanta" and "atlanta" to be valid. How should I edit this to get the validation love that I need? jQuery.validator.addMethod("atlanta", function(value) { return value == "Atlanta"; //Need 'atlanta' to work too }, '**Recipient must reside in Chicago City Limits**'); Pre thanks to any and all :)

    Read the article

  • jquery validate check at least one checkbox

    - by Omu
    I have something like this: <form> <input id='roles' name='roles' type='checkbox' value='1' /> <input id='roles' name='roles' type='checkbox' value='2' /> <input id='roles' name='roles' type='checkbox' value='3' /> <input id='roles' name='roles' type='checkbox' value='4' /> <input id='roles' name='roles' type='checkbox' value='5' /> <input type='submit' value='submit' /> <form> I would like to validate that at least one checkbox (roles) should be checked, is it possible with jquery.validate ?

    Read the article

  • jQuery timer, ajax, and "nice time"

    - by Mil
    So for this is what I've got: $(document).ready(function () { $("#div p").load("/update/temp.php"); function addOne() { var number = parseInt($("#div p").html()); return number + 1; } setInterval(function () { $("#div p").text(addOne()); }, 1000); setInterval(function () { $("#geupdate p").load("/update/temp.php");} ,10000); }); So this grabs a a UNIX timestamp from temp.php and puts into into #div p, and then adds 1 to it every second, and then every 10 seconds it will check the original file to keep it up to speed. My problem is that I need to format this UNIX timestamp into a format such as "1 day 3 hours 56 minutes and 3 seconds ago", while also doing all the incrementation and ajax calls. I'm not very experienced with jquery/javascript, so I might be missing something basic.

    Read the article

  • JQuery make an array - how/what is best

    - by russp
    I have 4 serailized arrays that I want to pass to php for processing. What is the best way to combine them into a single array example: serial_1 = $('#col1').sortable('serialize'); serial_2 = $('#col2').sortable('serialize'); serial_3 = $('#col3').sortable('serialize'); serial_4 = $('#col4').sortable('serialize');` each serialized array relates to a column/section of the page (col1,col2 etc.) What I need to do/would like to do is create a single array that puts the serialized array inside another array for a single post. example: var new_array = serilaize(col_1(serial_1),col2(serial_2),col3,(serial_3),col4(serial_4)) I KNOW THAT IS NOT RIGHT as I have no idea in JQuery how to right the correct syntax. This new array is to be posted via ajax like this: $.ajax({ url: "test.php", type: "post", data: new_array, error: function(){ alert('SOME ERROR MESSAGE'); } }); Thanks in advance

    Read the article

  • JQuery Validate Dynamic Table

    - by Richard
    I'm using the JQuery validation plug to validate my entire form. I also have a dynamic table on my registration page where the user can register more people. I can validate the rest of the form fine but my goal is to validate the table inputs just the same. Here is my jfiddle code: tables I don't know why the add line won't work there but it definitely works on my page. Anyway, that code ends up validate ONLY the first row of my table, but I want it to validate every single row. Can anyone see any problems with the code?

    Read the article

  • jQuery Plugin with $.getJSON Returning undefined?

    - by Oscar Godson
    Inside of a jQuery plugin I made I have: $.getJSON(base_url,{ agenda_id:defaults.id, action:defaults.action+defaults.type, output:defaults.output },function(json){ return json; }); And in a separate JS file (yes, it comes after the plugin): json = $('#agenda-live-preview').agenda({action:'get',type:'agenda',output:'json'}); alert(json[0].agenda_id); If i do the above $.getJSON and put an alert inside of the $.getJSON it works and returns "3", which is correct. If I do it like the json=$('#agenda-live-preview').agenda(...)... it returns undefined. My JSON is valid, and the json[0].agenda_id is correct also, I know it's in a callback, so how do I get the stuff inside of a callback in a function return?

    Read the article

  • JQuery Selector - Select this, not that?

    - by JasonS
    Hi, I have created a script which is surprisingly working. (I do not do much JavaScript) What I have is a load of images listed within a div. These images are hidden. JQuery gets the properties of the images and puts them into an array. When the body is clicked, the background image of the page changes. This works nicely. However, I now have a problem. There are several elements which I shouldn't change the background when they are clicked. Namely, navigation, footer and caption. How do I create a selector which makes the body clickable, yet ignores clicks on the above 3 div's?

    Read the article

  • Drag & Drop using jQuery-ui

    - by Dhruva Sagar
    Hi, I am currently working on a project where I have to create a custom calendar sort of application to display and manage appointments easily. I need to be able to drag and reschedule appointments appropriately. jQuery-ui is pretty neat and I am able to achieve almost everything except that I require that no appointments (divs) may overlap. I am not able to figure out how to achieve this. If someone could guide me into the right direction for this, it would be great. Thanking you in advance for your time and patience.

    Read the article

  • [validate plugin] custom rule error

    - by vitto
    hi i have added a rule to my form but i can't understand why it does not work!! http://www.pipelabitta.it/form/ This is an example page: the rules is that the check box must be checked and there must be a valid date. From firefox console i can see it returns true or false as i need but the validation does not get triggered. Why is that? Thanks Vitto

    Read the article

  • Jquery taconite selector with character that needs to be escaped

    - by hdx
    I'm using the jquery taconite plugin to make an ajax request that will replace a certain element in my page, however the element has an id like "email.subject".. I can select it just fine if I do '$("email\\.subject")', but when I try to use the taconite plugin like this: <taconite> <replaceWith select="#email\\.subject"> JUCA </replaceWith> </taconite> The plugin log says: [taconite] No matching targets for selector: #email\\.subject How can I make this work?

    Read the article

  • Applying JQuery UI css to a textarea element

    - by Felix Guerrero
    Hi. I'm using JQuery UI for a web based development at the University. I got some forms that I put into a dialog, so I got elements like <label for="name">ID user</label><input type="text" name="iduser" size="15" id="iduser" class="text ui-widget-content ui-corner-all" maxlength=12 /> But I got some textarea elements like <label for="name">Description</label><textarea name="description" id="description" class="text ui-widget-content ui-corner-all" value=""></textarea> The issue: textarea is not taking the css as inputs does, I mean, I got corner rounder textarea as input texts but the font size and font family don't.

    Read the article

  • jquery - lose click() event after ajax call???

    - by niczoom
    At the following webpage liamharding.com/pgi.php I have an option panel on the left side of the page which opens and closes upon clicking the panels 'arrow', this works fine until you select a market (for testing use one of the 'Random Walk' markets and click 'Show/Refesh Graphs'), this then makes an ajax call using get_graph(forexName, myCount, divIsNew) function. Once this call is completed a graph(s) is displayed and then my options panels click() event does not work? The ajax call returns the data in a variable ajax_data, the problem happens when I perform the following code var jq_ajax_data = $("<div/>").html(ajax_data); . I need to wrap it in a so I can extract data from it using jQuery. If this line of code is commented out the click() event works fine ?? Hope somebody can help, I have spent a lot of time but cant find what the problem is.

    Read the article

  • Is there a way to force a user to select an autocomplete value before they can submit the form?

    - by Randy Johnson
    I am using the jqueryui autocomplete feature to allow the user to select their location. I need to make sure they select a location from the autocomplete before they can submit the form. I don't want them to be able to submit the form before they select a value. My solution is after they submit make sure that the value found is in the database. The other solution would be that when they click submit or after they leave the location box and go to another field to submit the entry via ajax to ensure it is valid if not show an error and do not let them submit the form. I was wondering if there was something easier I could do, or if there is something more elegant. I realize they have to be able to type something into the box to get the autocomplete to work, so I could force them to select a value from the autocomplete because it is not a select box, so it seems that my above solutions would be the best way to go. Thoughts?

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >