Search Results

Search found 23364 results on 935 pages for 'jquery ui droppable'.

Page 135/935 | < Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >

  • InvalidAuthenticityToken for JQuery despite setting authenticity token

    - by user117046
    I'm getting an InvalidAuthenticityToken despite adding in corresponding authenticity tokens in the jquery response. Is there an error in the code, or is there another, root problem? I appreciate any comments. Thanks! Using: Rails 2.3.3, Ruby 1.8.6, Webrick, JQuery 1.3.2 layout/networks.html.haml = token_tag = javascript_tag "window.AUTH_TOKEN = '#{form_authenticity_token}';" javascripts/application.js $(document).ready(function() { // All non-GET requests will add the authenticity token // if not already present in the data packet $(document).ajaxSend(function(event, request, settings) { if (typeof(window.AUTH_TOKEN) == "undefined") return; // <acronym title="Internet Explorer 6">IE6</acronym> fix for http://dev.jquery.com/ticket/3155 if (settings.type == 'GET' || settings.type == 'get') return; settings.data = settings.data || ""; settings.data += (settings.data ? "&" : "") + "authenticity_token=" + encodeURIComponent(window.AUTH_TOKEN); }); ajaxLinks(); }); The rendered html has: <input name="authenticity_token" type="hidden" value="ZaXj3ACQl+8JKtaDAUoxtSsqzEagSPyHbS25ai9qWCw=" /> <script type="text/javascript"> //<![CDATA[ window.AUTH_TOKEN = 'ZaXj3ACQl+8JKtaDAUoxtSsqzEagSPyHbS25ai9qWCw='; //]]> </script> and breakpointing through, shows that window.AUTH_TOKEN has been set. Any help to resolve this would be great.

    Read the article

  • Jquery html grab + calling a controller action using javascript (ruby on rails)

    - by Zind
    Preface: I consider myself "slightly effective" in ruby on rails, and a complete novice in javascript. Also, yes, I have installed jQuery and associated plugins instead of the default Prototype library. I am in a situation where I am pulling in a table from off-site in an iframe (which is taking care of all internal JS for me) such that when a part of the table is clicked, a td will gain the class "active." What I would like to do is take this info (I'm assuming I can get it in a string format), and pass it to a method (in my controller, I'm assuming) which will parse the html, pull out the pertinent info, and then call a creation method in the same controller with the parsed info, the end result being a new item in that table. What I have so far is javascript which I believe is correct so far: <script type="text/javascript"> var ImportInfo = function() { var info = $('td.active').html(); // call controller action which parses the given string, //checks for existence in database, and adds new row if needed } $("#Import").click(ImportInfo); </script> and, of course, a button with id="ImportLocation." I have looked at this question: http://stackoverflow.com/questions/1334447/using-jquery-to-call-a-controller-action but am somewhat unsure as to how to call a controller action to pass the contents of the td as a string. Is this doable with the jQuery post method?

    Read the article

  • jQuery filename manipulation

    - by Adi
    Hi all, I am trying to do a fancy blur/fade effect (which means i need 2 images) but I only want to load 1 in the HTML (in case js is not active) and add the other filename via jQuery (copying and renaming the file/src) The pure html is along the lines of: <div id="work"> <div> <img src="css/images/abc1.jpg" width="360" height="227" alt="" /> </div> <div> <img src="css/images/xyz1.jpg" width="360" height="227" alt="" /> </div> </div> But the html after jquery has manipulated the DOM needs to be like: <div id="work"> <div> <img src="css/images/abc0.jpg" width="360" height="227" alt="" /> <img src="css/images/abc1.jpg" width="360" height="227" alt="" /> </div> <div> <img src="css/images/xyz0.jpg" width="360" height="227" alt="" /> <img src="css/images/xyz1.jpg" width="360" height="227" alt="" /> </div> </div> The question is, what is the jQuery to clone/copy the relative images and then rename the src? Any help would be much appreicated. A.

    Read the article

  • incorporate simple vimeo video request with jquery carousel

    - by Andrew Welch
    Hi, I did a tutorial for a jquery carousel that scrolls a ul. At the moment the ul is hardcoded, but I want to use a simple call to vimeo api to bring in the videos for a certain user into the carousel. I have uploaded my code here: http://www.welchcreative.co.uk/wp-content/infinitecarouselvimeo.zip My problem is that I don't know where I should put the code for the simple vimeo call, because at the moment, I think that the problem is that the vimeo videos load after the jquery stuff because it uses window.onload rather than document ready and I can't seem to work out how to put the two and two together. Ideally, 1. the code loads the vimeo videos first and puts them in a ul wiht the correct classes. 2. the carousel code then acts on the list above. in that order. I hope that isn't too vague. It's a pretty simple idea. I'm new to javascript and jquery. Thanks Andy

    Read the article

  • jQuery Flow Control (if then from URL params)

    - by Ryan Max
    Strangely enough I am more familiar with jQuery than I am with javascript. I need to be able to add a class to the body tag of a document depending on what specific forum page i'm on in a phpbb forum. Due to the nature of phpbb I can't actually do this flow control in php, so I am using jquery. Here's my code (the first part is an extend that gets the url parameters like so http://www.mysite.com/viewforum.php?f=3 var forum = $.getUrlVar('f'); will make forum == 3 because of the nature of phpbb i can't really do any flow control with php. So I am using jquery. This is my code: $(document).ready(function(){ $.extend({ getUrlVars: function(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }, getUrlVar: function(name){ return $.getUrlVars()[name]; } }); }); $(document).ready(function(){ var forum = $.getUrlVar('f'); if (forum == 3){ $('body').toggleClass('black'); } }); Yet this isn't working. Any idea why not?

    Read the article

  • jQuery validator not working in unit testing

    - by Dbugger
    I have this small HTML file: <html> <head></head> <body> <form id='MyForm'> <input type='text' required /> <input type='submit' /> </form> <script src="/js/jquery-1.9.0.js"></script> <script src="/js/jquery.validate.js"></script> <script> var validator = $("#MyForm").validate(); alert(validator.form()); </script> </body> </html> This alerts me with "false", which is the expected behaviour. The problem comes when I go to unit testing, with js-test-driver: TestCase("MyTests", { setUp: function() { this.myform = "<form id='MyForm'><input type='text' required /><input type='submit' /></form>"; this.validator = $(this.myform).validate(); jstestdriver.console.log("Does the form validate? " + this.validator.form()); }, test_empty: function() { }, }); This code returns me the string Does the form validate? true This is a simplified version of my project of course, but the point is that I dont seem to be able to unit test the validation module im developing, since the jQuery validate plugin doesnt seem to work. What am I missing?

    Read the article

  • jQuery: Multiple animations with a delay on a set of divs

    - by Waleed
    Hey there, I have a group of 4 divs and I'm looking to use jQuery to animate them once, then have a delay using delay(), and then run another set of animations on them, putting the divs back to their original configuration. Here's the code that I have: //only selectors called 'option1' are affected by delay, and not 'option1 img' or 'option2' $("#option1").showOption1().delay(3000).hideOption1(); //if i don't attach to #option1, delay doesn't work, but the animations that need to happen simultaneously work $(document).showOption1().delay(3000).hideOption1(); jQuery.fn.showOption1 = function(){ $("#option2, #option3, #leftColumn").fadeOut(1000); $("#option1").css("zIndex", "5"); $("#option1").animate({ left: "370px", }, 1500); $("#option1 img").animate({ width: "500px", }, 1500, function(){ $("p.optionText").text('hello'); }); return this; } jQuery.fn.hideOption1 = function(){ $("#option1 img").animate({ width: "175px", }, 1500); $("#option1").animate({ left: "743px", }, 1500); $("#option2, #option3, #leftColumn").fadeIn(2000); $("#option1").css("zIndex", "1"); return this; } I've tried two ways of running these two functions, as seen on lines 2 and 5. In the case of line 2, showOption1() will run fine, but then only $("#option1").animate({ left: "743px", }, 1500); will work from hideOption1() after the delay. The rest of hideOption1() is fired immediately after showOption1() finishes, ignoring the delay. On the other hand, if I run line 5, all the code in hideOption1() runs simultaneously as desired, but ignores the delay entirely, running immediately after showOption1() finishes. How can I have all the code in hideOption1() run simultaneously after the delay? Thanks much in advance!

    Read the article

  • jquery form validation: validation script specified externally

    - by Abu Hamzah
    i have a jquery form validation in the master page and it works fine and i got that working from this article: http://www.dotnetcurry.com/ShowArticle.aspx?ID=310 my question is: if i place the .js to external and add a reference to my page then its not working... it says object expected here is how i have done: in my content page (i am using master page, asp.net ) add in my content page: <script src="myform_validation.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { ValidateMe(this); }); </script> below is in the external .js file: function ValidateMe() { $("#aspnetForm").validate({ rules: { <%=TextBox1.UniqueID %>: { maxlength:1, //minlength: 12, required: true }, <%=TextBox2.UniqueID %>: { minlength: 12, required: true }, <%=TextBox3.UniqueID %>: { minlength: 12, required: true }//, // }, messages: { <%=TextBox1.UniqueID %>: { required: "Enter your firstname", minlength: jQuery.format("Enter at least {0} characters") }, <%=TextBox2.UniqueID %>: { required: "Please enter a valid email address", minlength: "Please enter a valid email address" } , <%=TextBox3.UniqueID %>: { required: "Enter your firstname", minlength: jQuery.format("Enter at least {0} characters") } } , success: function(label) { // set &nbsp; as text for IE label.html("&nbsp;").addClass("checked"); } }); } ;

    Read the article

  • jQuery/Ajax with Zend Framework

    - by Nathan
    I've been tinkering around with Zend-Framework and Jquery for a month or so, and finally started tinkering with them together using ZendX_JQuery. It seems I've ran into something that at first seemed it should be simple, So maybe I'm just missing something here. I have a view along the lines of: $this->ajaxLink( $this->escape($var->title), $this->baseUrl() . "/another/action", array('update' => '#domain' . $var->id , 'complete' => '$("#domain' . $var->id .'").toggle("slow");')); echo '<div id="domain"' . $var->id . '" style="display:none;" ></div>'; Which works correctly, when the link displayed by the code above is clicked it loads the contents returned from /another/action into the domain"id" div. The problem occurs when the view loaded by the above contains an ajaxLink() the ajax link stops working. This can be fixed by adding an option to the ajaxLink() array "inline" = true but what if I need other JQuery views helpers to work when loaded into the page via ajax i.e. dialogContainer() I guess I could simply be asking how to control where zendx jquery helper puts java script. by default it is trying to put all statments in the <head> section in a single <script> tag. I need away around that for views displayed from an ajax call. Does Dojo try and force all php rendered javascript/ajax into the head also? Thanks.

    Read the article

  • jQuery ajax success chaining Internet Explorer Issues

    - by Nickd
    I have a jQuery ajax function that retrieves JSON data. In the success block I call another function to parse the data and update the page. At the end of this parsing/updating function a different ajax call is made. This works perfectly in all browsers except Internet Explorer (7 and 8). The problem is Internet explorer thinks the script is taking too long to process because the success block from the first ajax call doesn't complete until the 2nd ajax call finishes. I get the message: "Stop running this script? A script on this page is causing your web browser to run slowly. If it continues to run, your computer might become unresponsive." My jQuery code: $("#id_select").bind("change", function(e){ $.ajax({ url: "/retrieve_data.js", data: {id:$(e.target).children(":selected").attr("value")}, type: "get", dataType:"json", success: function(data, status, form){ processData(data); }, error: function(response, status){ alert(response.responseText); } }); }) Any suggestions on how to get IE to stop timing out or to accomplish this task without rewriting all my jQuery functions would be appreciated.

    Read the article

  • jQuery Autocomplete Json Ajax cross browser issue with Google Search Appliance

    - by skyfoot
    I am implementing a jquery autocomplete on a search form and am getting the suggestions from the Google Search Appliance Autocomple suggestions service which returns a result set in json. What I am trying to do is go off to the GSA to get suggestions when the user types something in the search box. The url to get the json suggestions is as follows: http://gsaurl/suggest?q=<query>&max=10&site=default_site&client=default_frontend&access=p&format=rich The json which is returned is as follows: { "query":"re", "results": [ {"name":"red", "type":"suggest"}, {"name":"read", "type":"suggest"}] } The jQuery autocomplete code is as follows: $(#q).autocomplete(searchUrl, { width: 320, dataType: 'json', highlight: false, scroll: true, scrollHeight: 300, parse: function(data) { var array = new Array(); for(var i=0;i<data.results.length;i++) { array[i] = { data: data.results[i], value: data.results[i].name, result: data.results[i].name }; } return array; }, formatItem: function(row) { return row.name; } }); This works in IE but fails in firefox as the data returned in the parse function is null. Any ideas why this would be the case? Workaround I created an aspx page to call the GSA suggest service and to return the json from the suggest service. Using this page as a proxy and setting it as the url in the jQuery autocomplete worked in both IE and FireFox.

    Read the article

  • How to make this jquery function reusable?

    - by Pandiya Chendur
    Hai this is my jquery function, function getRecordspage(curPage, pagSize) { $.ajax({ type: "POST", url: "Default.aspx/GetRecords", data: "{'currentPage':" + curPage + ",'pagesize':" + pagSize + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(jsonObj) { var strarr = jsonObj.d.split('##'); var jsob = jQuery.parseJSON(strarr[0]); $.each(jsob.Table, function(i, employee) { $('<div class="resultsdiv"><br /><span class="resultName">' + employee.Emp_Name + '</span><span class="resultfields" style="padding-left:100px;">Category&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.Desig_Name + '</span><br /><br /><span id="SalaryBasis" class="resultfields">Salary Basis&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.SalaryBasis + '</span><span class="resultfields" style="padding-left:25px;">Salary&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.FixedSalary + '</span><span style="font-size:110%;font-weight:bolder;padding-left:25px;">Address&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.Address + '</span></div>').appendTo('#ResultsDiv'); }); $(".resultsdiv:even").addClass("resultseven"); $(".resultsdiv").hover(function() { $(this).addClass("resultshover"); }, function() { $(this).removeClass("resultshover"); }); } }); } In my page i have this jquery script, $("#lnkbtn0").click(function() { getRecordspage(1, 5) }); And my page has <a ID="lnkbtn0" class="page-numbers">1</a> <a ID="lnkbtn1" class="page-numbers">2</a> <a ID="lnkbtn2" class="page-numbers">3</a> <a ID="lnkbtn3" class="page-numbers">4</a> How to make other link buttons to call this function with diff curPage parameter...

    Read the article

  • Using jQuery delay() with separate elements

    - by boomturn
    I want to fake a simple animation on page load by sequentially revealing several pngs, each appearing instantly but with unique, precisely timed delay before the next one. Using the latest version of jQuery (1.4.2 at writing), which provides a delay method. My first (braindead) impulse was: $('#image1').show('fast').delay(800); $('#image2').show('fast').delay(1200); $('#image3').show('fast'); Of course all come up simultaneously. jQuery doc examples refer to a single item being chained, not handling multiple items. OK... try again using nested callbacks from show(): $('#image1').show('fast', function() { $('#image2').show('fast', function() { $('#image3').show('fast', function() { }); }); }); Looks ugly (imagine doing 10, also wonder what processor hit would be) but hey, it works sequentially! Without delay though. So... chain delay() after show() using a callback function from it (not even sure if it supports one): $('#image1').show('fast').delay(800, function() { $('#image2').show('fast').delay(1200, function() { $('#image3').show('fast'); }); }); Hm. Opposite result of what I thought might happen: the callback works, but still no delay. So... should I be using some combination of queue and delay instead of nested callbacks? jQuery doc examples for queue again only use one element for example. Guessing this would involve using a custom queue, but am uncertain how to implement this. Or maybe I'm missing a simple way? (For a simple problem!)

    Read the article

  • jQuery performance

    - by jAndy
    Hi Folks, imagine you have to do DOM manipulation like a lot (in my case, it's kind of a dynamic list). Look at this example: var $buffer = $('<ul/>', { 'class': '.custom-example', 'css': { 'position': 'absolute', 'top': '500px' } }); $.each(pages[pindex], function(i, v){ $buffer.append(v); }); $buffer.insertAfter($root); "pages" is an array which holds LI elements as jQuery object. "$root" is an UL element What happens after this code is, both UL's are animated (scrolling) and finally, within the callback of animate this code is executed: $root.detach(); $root = $buffer; $root.css('top', '0px'); $buffer = null; This works very well, the only thing I'm pi**ed off is the performance. I do cache all DOM elements I'm laying a hand on. Without looking too deep into jQuery's source code, is there a chance that my performance issues are located there? Does jQuery use DocumentFragments to append things? If you create a new DOM element with var new = $('<div/>') it is only stored in memory at this point isnt it?

    Read the article

  • jQuery Autocomplete plugin (Jorn Zaefferer's) - how to dynamically change the list of displayed valu

    - by Max Williams
    I'm using Jorn Zaefferer's Autocomplete query plugin, http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ I have options set so it shows all the values when you click in the empty text field, a bit like a select, and the option is also set so that the user can only choose from the list of values used by the autocomplete (so it's kind of like a select but with autocomplete functionality). I have two radio buttons below the text field, which determine whether the user chooses from a long list or a short list of possible values. I want to update the values used in the autocomplete when one of these radio buttons is clicked. Currently i'm doing this in a not very clever way by calling autocomplete again on the same text field, with the different array of values, but this creates a situation where both are active at once, and i can see the long list peeking out from behind the short list. What i need to do is either a) dynamically change the values used in the autocomplete or b) remove (unbind?) the autocomplete from the text field before re-initialising it. Either of these would do tbh though option a) is kind of nicer. Any ideas anyone? Here's my current code: function initSubjectLongShortList(field, short_values, long_values){ $(".subject_short_long_list").change(function(){ updateSubjectAutocomplete(field, short_values, long_values); }); updateSubjectAutocomplete(field, short_values, long_values); } function updateSubjectAutocomplete(field, short_values, long_values){ if($(".subject_short_long_list:checked").attr('id') == "subject_long_list"){ initSubjectAutocomplete(field, long_values); } else { initSubjectAutocomplete(field, short_values); } } function initSubjectAutocomplete(field, values){ jQuery(field).autocomplete(values, { minChars: 0, //make it appear as soon as we click in the field max: 2000, scrollHeight: 400, matchContains: true, selectFirst: false }); } cheers, max

    Read the article

  • SoundManager / Jquery / Regular expression : Parse class name before certain character To Get SoundI

    - by j-man86
    So I am trying to access a jquery soundmanager variable from one script (wpaudio.js – from the wp-audio plugin) inside of another (init.js – my own javascript). I am creating an alternate pause/play button higher up on the page and need to resume the current soundID, which is contained as part of a class name in the DOM. Here is the code that creates that class name in wpaudio.js: function wpaButtonCheck() { if (!this.playState || this.paused) jQuery('#' + this.sID + '_play').attr('src', wpa_url + '/wpa_play.png'); else jQuery('#' + this.sID + '_play').attr('src', wpa_url + '/wpa_pause.png'); } Here is the output: where wpa0 would be the sID of the sound I need. My current script in init.js is: $('.mixesSidebar #currentSong .playBtn').toggle(function() { soundManager.pauseAll(); $(this).addClass('paused'); }, function() { soundManager.resumeAll(); $(this).removeClass('paused'); }); I need to change resumeAll to "resume(this.sID)", but I need to somehow store the sID onclick and call it in the above function. Alternately, I think a regular expression that could get the class name of the current play button and either parse the string up to the "_play" or use a trim function to get rid of "_play"– but I'm not sure how to do this. Thanks for your help!

    Read the article

  • simple jquery fetch from mysql

    - by JPro
    I am trying to use jQuery with MYSQL and I wrote something like this : <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script> function example_ajax_request() { $('#example-placeholder').html('<p>Loading results ... <img src="ajax-loader.gif" /></p>'); $('#example-placeholder').load("loadres.php"); } </script> </head> <body> <div id="query"> <select name="show" id="box" > <option value="0">Select A Test</option> <option value="All">--All--</option> <option value="M1">Model1</option> </select> <input type="button" onclick="example_ajax_request()" value="Click Me!" /> </div> <div id="example-placeholder"> <p>Placeholding text</p> </div></body> </html> Basically I want to pass parameters to the loadres.php file. But unable to figure out the exact way to do. Any help is appreciated. Thanks.

    Read the article

  • jQuery and XHTML layout problems in ie7

    - by abysslogic
    Hi there, I am back again with more layout problems on my up and coming website. I am able to achieve the proper animation, positioning and results with my layout / splash on every modern browser (excluding ie7 or older). I have an image in the center of the page, that is text-align: center'd, and pushed to a vertical center by having a div (#SPLASH_HEAD) set to 50% on the top half of the page. The loading animation changes the height of #SPLASH_HEAD to 0px, to drag the image to the top (and then do other things). In ie7 (or compatability mode), it appears that there is an error in jquery-1.4.2.min.js, line 116 char 165 (which I dont think has anything to do with the actual jQuery file itself). The splash is not centered either vertically (#SPLASH_HEAD does not register at 50% of window height) and is not centered properly with margin-left. Also, none of the other elements are hidden properly (with .hide()) as ie7 does not appear to be loading all of my jQuery / javascript. heres a link: www.voidsync.com/test (it would be easier to view the source on there) thanks!

    Read the article

  • jQuery.load doesn't execute javascript with document.write

    - by Garfield
    I am trying to use jQuery.Load to load an ad call that has a document.write, and for some reason its not able to, or in firefox atleast, reloads the page with the entire ad. Here is the simplified version of the code. DynamicLoad.html <html> <head> <script src="http://www.prweekus.com/js/scripts.js?3729212881" type="text/javascript"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery Load of Script</title> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1.3.2"); </script> <script type="text/javascript"> $(document).ready(function(){ $("#myButton").click(function() { $("#myDiv").load("source.html"); }); }); </script> </head> <body> <button id="myButton">Click Me</button> <div id="myDiv"></div> <div id="slideAdUnit"></div> </body> </html> Source.html <script language="javascript" type="text/javascript"> document.write('<script language="javascript" type="text/javascript"><\/script>'); </script> test Once you click the button in FF the browser just waits for something to load. Any thoughts ? Eventually I would be passing a src element in the document.write which points to our ad server. Thanks for your help.

    Read the article

  • SoundManager / Jquery : Get SoundID sID

    - by j-man86
    So I am trying to access a jquery soundmanager variable from one script (wpaudio.js – from the wp-audio plugin) inside of another (init.js – my own javascript). I am creating an alternate pause/play button higher up on the page and need to resume the current soundID, which is contained as part of a class name in the DOM. Here is the code that creates that class name in wpaudio.js: function wpaButtonCheck() { if (!this.playState || this.paused) jQuery('#' + this.sID + '_play').attr('src', wpa_url + '/wpa_play.png'); else jQuery('#' + this.sID + '_play').attr('src', wpa_url + '/wpa_pause.png'); } Here is the output: <img src="http://24.232.185.173/wordpress/wp-content/plugins/wpaudio-mp3-player/wpa_play.png" class="wpa_play" id="wpa0_play"> where wpa0 would be the sID of the sound I need. My current script in init.js is: $('.mixesSidebar #currentSong .playBtn').toggle(function() { soundManager.pauseAll(); $(this).addClass('paused'); }, function() { soundManager.resumeAll(); $(this).removeClass('paused'); }); I need to change resumeAll to "resume(this.sID)", but I need to somehow store the sID onclick and call it in the above function. Alternately, I think a regular expression that could get the class name of the current play button and either parse the string up to the "_play" or use a trim function to get rid of "_play"– but I'm not sure how to do this. Thanks for your help!

    Read the article

  • jquery disable/remove option on select?

    - by SoulieBaby
    Hi all, I have two select lists, I would like jquery to either remove or disable a select option, depending on what is selected from the first select list: <select name="booking" id="booking"> <option value="3">Group Bookings</option> <option value="2" selected="selected">Port Phillip Bay Snapper Charters</option> <option value="6">Portland Tuna Fishing</option> <option value="1">Sport Fishing</option> </select> Here's the second list (which will only ever have two values): <select name="charterType" id="charterType"> <option value="1">Individual Booking</option> <option value="2">Group Booking</option> </select> If Group Bookings or Port Phillip Bay Snapper Charters are selected, I need only "Group Booking" to be displayed. (To basically hide "Individual Booking") but I can't seem to get it to work.. If someone could help me that'd be great!! :) I've also tried using a switch, but that doesnt work either.. /* select list */ switch (jQuery('#booking :selected').text()) { case 'Sport Fishing': alert('AA'); break; case 'Port Phillip Bay Snapper Charters': jQuery("#charterType option[value=1]").remove(); alert('BB'); break; case 'Portland Tuna Fishing': alert('CC'); break; case 'Group Bookings': alert('DD'); break; }; It alerts, but doesn't do anything else..

    Read the article

  • Jquery .hide problem

    - by Sergio
    I'm using jquery to show animated MSN like window at the bottom of the page. Jquery code: $(document).ready(function() { $(" .inner").stop().animate({height:'142px'},{queue:false, duration:600}); $(' .close').click(function(event) { $(' .inner').hide(); }); $(' .inner').click(function() { location.replace("somepage.php"); }); }); The CSS: .close {height:14px; z-index:100; position: absolute; margin-left:174px; margin-top:12px; border:1px solid #F00;} .inner {position:absolute;bottom:0;width:201px;height:117px;right: 0; margin-right:10px; float:left; z-index:-1; display:block; cursor:pointer;} The problem that I have with this code is that the close button (showing at the right top corner of .inner DIV) can't fire Jquery .hide function. Why?

    Read the article

  • Use jQuery to get values of dropdownlists in an html table column for each row

    - by Arnold
    Hi All, I have a requirement to build a simple html table of memos. The table consists of n-rows each with 2 columns: (1) a dropdownlist of types of memos and (2) the text of a memo - a textbox. I have successfully implemented jQuery to allow the user to Add a new row. That entails the selecting of a type of memo and then typing something into the textbox. I've also implemented jQuery to allow the user to mark a memo row for deletion. This is a partial view and the Save is handled by a container page. Requirements stipulate that there can be only one type of memo in the table. What I would like to be able to do is this: When the user clicks the Add button to add a new row (after having selected the memo type and entered some text into the textbox) I want the code to first examine each row in the table getting the value for each memo type dropdownlist. If the newly entered dropdownlist value is the same as one previously entered, I want to abort the add row process. Requirements also stipulate that all dropdownlists remain enabled to allow the user to change the memo type at any time. Similarly, I would like to be able to scan the table checking to see if that same memo type has already been entered. What would the jQuery look like for this kind of validation? Thanks! Arnold

    Read the article

  • JQuery jqGrid vertical spacing issue in IE

    - by JW
    I have been developing an app to use jQuery's jqGrid plugin, and I thought I had it all wrapped up until I tried to view the grid in IE. In IE, the grid appears with a much larger height in the .ui-jqgrid-view div, but the data itself stays at a smaller size and displays at the bottom of the container div (.ui-jqgrid-view). I need to get the grid to display "properly". I don't care if it is the larger size (that IE displays) or smaller (as in FF)... I just need to have the data fill the grid area. Thanks! I uploaded a screenshot: here Grid Code: $("#list").jqGrid({ url: gDataPath, datatype: 'json', mtype: 'GET', colNames: ['Id', 'VId', 'First Name', 'Last Name', 'MId'], colModel: [ { name: 'ID1', index: 'ID1', width: 75, align: 'left' }, { name: 'VID', index: 'VID', width: 75, align: 'left' }, { name: 'FirstName', index: 'FirstName', width: 225, align: 'left' }, { name: 'LastName', index: 'LastName', width: 225, align: 'left' }, { name: 'MIDno', index: 'MIDno', width: 260, align: 'left'}], pager: jQuery('#pager'), rowNum: 100, rowList: [50, 100, 200, 500], sortname: 'ID1', sortorder: "desc", viewrecords: true, imgpath: 'http://mysite/Content/images', caption: 'Project Name Data', ondblClickRow: function(rowid, iRow, iCol) { var i = jQuery("#list").getRowData(rowid); window.location = '<%=linkPath %>/'+ i.VisitID; } });

    Read the article

  • Jquery menu with less code

    - by Sergio
    I'm using Jquery for menu created like: <div class="prof_info1">home</div><div class="prof_info2">info2</div><div class="prof_info3">info3</div> And Jquery code like: $(document).ready(function(){ $(".prof_info1").unbind("click").click(function(event) { $("#main").html('<img src="img/spin.gif" class="spin">'); location.replace("?&id=<?=$id?>") return false; }); $(".prof_info2").unbind("click").click(function(event) { $("#main").html('<img src="img/spin.gif" class="spin">'); $("#main").load('?a=2&id=<?=$id?>'); return false; }); $(".prof_info3").unbind("click").click(function(event) { $("#glavni").html('<img src="img/spin.gif" class="spin">'); $("#glavni").load('?a=3&id=<?=$id?>'); return false; }); }); Is there any easier way to do write this Jquery code and make it with less code? Something like if click somethind{ ... }elseif{ ....}

    Read the article

< Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >