[jQuery] Re: li/img click and window.keydown
up ! (wow, this forum gets 10 new posts per hour) On 15 juil, 21:52, Lideln lid...@gmail.com wrote: Hi everybody ! I have a jqModal window, and I would like to close it using the ESC key. For that purpose, I assign my modal a keydown() event, and if keyCode == 27, I close the modal. It works fine, except when I click on another element in the modal first I have to press 2 times ESC : the first time removes the focus from the element, the second time goes through my listener and closes the modal. In my modal , I have an ul/li list, each li containing an img (for the purpose of an image gallery). When I click on an image (or li ?), I have to press twice ESC to close the modal. I tried to add a $(this).blur() in the li click() event, and also I tried to put that in the img click event, but without success... Does somebody know why it is doing that, and how to fix it, please ? Thanks a lot !
[jQuery] Re: Value adding to drop down
The code looks fine to me. Could you post the data value? What is the browser you are using? On Jul 16, 2:58 pm, naz s.na...@gmail.com wrote: hi i m adding some values to drop down by usind j query by this code var programs=[]; programs=data.split('|'); $('#p_course').length = 1; for(var i=0;iprograms.length-1;i++) { var objDropdown =$('#p_course').get(0); var objOption = new Option(programs[i],programs[i]); objDropdown.options[objDropdown.length] = objOption; } but when vales appear in drop down first value look like this |BSIT any body have any idea why it look like this
[jQuery] Re: Can this plugin be structured better?
May be something like this? (function($) { $.fn.editable = function(options) { var defaults = { // default value declarations } var opts = $.extend(defaults, options); return this.each(function() { var $this = $(this); // Cache a jQuery version of this var tag = $this.get(0).tagName; var obj; this.doSomething = obj.doSomething; switch (tag) { case 'DIV': obj = new $.myDiv(); obj.init(); break; case 'IMG': obj = new $.myImg(); obj.init(); break; } }); } })(jQuery); jQuery.myImg = function() { { this.init = initImg; this.doSomething = imgFunction; return this; function initImg() { } function imgFunction() { } } jQuery.myDiv= function() { this.init = initDiv; this.doSomething = divFunction; return this; function initDiv() { } function divFunction() { } } On Jul 12, 6:37 pm, Harvey scottandrewhar...@gmail.com wrote: Hey, I'm in the process of developing a new plugin but the way I have structured the codes doesn't seem quite right to me so I'm hoping someone might be able to offer a better way to do it. The plugin itself has different behaviour if called on different types of elements (images, divs etc) with a range of shared functions used across all element types. This is the basic structure I have so far: (function ($) { $.fn.editable = function (options) { var defaults = { // default value declarations } var opts = $.extend(defaults, options); return this.each(function () { var $this = $(this); // Cache a jQuery version of this var tag = $this.get(0).tagName; switch(tag) { case 'DIV': initDiv(); break; case 'IMG': initImage(); break; } function initDiv () { // initialise the plugin to work with divs } function initImage () { // initialise the plugin to work with images } // functions used by divs only function divFunction () { // body... } // functions used by images only function imageFunction () { // body... } // functions used by divs and images function sharedFunction () { // body... } }); } })(jQuery); The reason it does seem right to me is because any instance of the plugin called on a div will also contain all the code that is used if it was an image even though the code won't be used. Can any offer something better?
[jQuery] Re: Can this plugin be structured better?
I did think of that solution but where would I put functions shared by myImg and myDiv that need access to the $this and tag variables?
[jQuery] if button clicked then do this else do that
Hello, I am trying to do something like this. if a button is clicked call one function $('.saveButton').click(function(){ call one function }); else call another function. But I don't have any idea how to implement if else in a clicked event. Can any one help me?
[jQuery] $(document).unload() does not fire.
Hello, I am extensively using jquery.ajax calls to display data on my web page (which build using partial rendering). In certain navigation flow a user move from one page to another. Before he moves I need to capture information filled in by user in first page(form) and save it in java script variable. Since my complete page is built using partial rendering the first form gets unloaded and new form gets loaded making ajax call. In order to capture the data user has filled in first form I have tried to use $(document).unload, $.unload(), $(#form_id).unload() (form_id is the id of the form in the page) to update the java script variable with user's input for form1. But neither scenario my call back function gets fired. I am not sure if I unload will be corrent event to add callback function to update user input. Any pointers and help on how to make my callback function fire will be appreciated. Thanks n Regards, Nitin
[jQuery] (Validation) How to submit a form without validating
Hi, I am using the Jquery validationss plugin for my form validations. Now I have a situation where I have two submit buttons in a single form (say button A and button B). For button A, I want to run validations but for button B I don't want to run the validations and submit the form without validating.. How can i do this? Thanks.
[jQuery] Re: URL generated by Ajax
thanks for this it does the job nicely. Regards JD On Jul 15, 1:59 pm, Peter Edwards p...@bjorsq.net wrote: Hi JD, In your success callback, you have access toajaxoptions through the this keyword, so you can get the fullURLby doing this within the success callback: alert(this.url+'?'+this.data); peter on 15/07/2009 13:30 Mean Mike said:: if you just need to see what your posting and whaturlits going too why not just view it in httpfox ? On Jul 15, 6:54 am, JD odonovan.jo...@gmail.com wrote: Hi Guys, This is probably a very simple question, i'm new to JQuery but I can't find the solution. I create an AjaxReqest with aurland some post data. Is there any way that i can alert out theURLwhich is thengeneratedin the call. Example url:www.yahoo.com/login postdata: username=user password=pass Creates something along the lines ofwww.yahoo.com/login?username=userpassword=pass Obviously the real calls are much more complex. I have read somewhere that the argument to the onSuccess function should expose a .urlfunction but this doesn't seem to work. Any help is appreciated. Thanks JD
[jQuery] Re: URL generated by Ajax
Yes i might try this as well, thanks On Jul 15, 1:30 pm, Mean Mike mcgra...@gmail.com wrote: if you just need to see what your posting and whaturlits going too why not just view it in httpfox ? On Jul 15, 6:54 am, JD odonovan.jo...@gmail.com wrote: Hi Guys, This is probably a very simple question, i'm new to JQuery but I can't find the solution. I create an AjaxReqest with aurland some post data. Is there any way that i can alert out theURLwhich is thengeneratedin the call. Example url:www.yahoo.com/login postdata: username=user password=pass Creates something along the lines ofwww.yahoo.com/login?username=userpassword=pass Obviously the real calls are much more complex. I have read somewhere that the argument to the onSuccess function should expose a .urlfunction but this doesn't seem to work. Any help is appreciated. Thanks JD
[jQuery] Re: (Validation) How to submit a form without validating
You can add a class=cancel to that button B. The plugin will then skip the validation. Jörn On Thu, Jul 16, 2009 at 9:05 AM, mnaveedmnaveed...@gmail.com wrote: Hi, I am using the Jquery validationss plugin for my form validations. Now I have a situation where I have two submit buttons in a single form (say button A and button B). For button A, I want to run validations but for button B I don't want to run the validations and submit the form without validating.. How can i do this? Thanks.
[jQuery] Re: Chained Autocomplete selects
You can bind it to a custom event. You don't have to use the change event on the parent select. Another option is to manually fire the change event on $.ready(). On Jul 1, 12:01 pm, brotherjames james.montgom...@terex.com wrote: Is there an easy way with theCascadeplugin to tie to events in addition to change... The issue is that theCascadeworks well when the parent is changed but does not show the child value on an update form as the parent in most cases do not need to change... but the child is not displayed because the change event is not nor does it need to be fired. On Jun 11, 12:30 am, Mike Nichols nichols.mik...@gmail.com wrote: I'd look at the autocomplete plugin herehttp://github.com/ReinH/jquery-autocomplete/tree/master and a decent write up here :http://www.bigredswitch.com/blog/2008/11/jquery-autocomplete-plugin/ I used this tiny plugin as a kind of prototype when I wrotecascade. Incidentally, I have a few fixes tocascadeto push out (dynamic ajax, etc) if you need it. Personally, I wouldn't use a select tag for that many options, but would opt for autocomplete. You can use the same datasource (JSON) and bind similar behavior on the autocomplete box. mike On Jun 10, 9:45 pm, netcomp ra...@netcompulsion.com wrote: Hi there. I have a page that loads two other pages in with load. In one of the files there are two select lists,chainedtogether using theCascadeplugin. I have embedded theCascadeplugin in the page that gets loaded. This works fine. However, the first list contains upwards of 2200 items and people are having trouble finding the proper choice. So now I need to add a filter or auto complete functionality. I'm having a problem getting the wheels rolling on this one...anyone have an example or suggestion of how I can accomplish both tasks? The current lists are fed by a JSON file I generate dynamically. TIA
[jQuery] Re: Can this plugin be structured better?
In the object init, pass this. switch (tag) { case 'DIV': obj = new $.myDiv(); obj.init ($this);break; jQuery.myDiv= function() { this.init = initDiv; this.doSomething = divFunction; this.actualObject; return this; function initDiv(obj) { this.acutalObject = obj; } function divFunction() { // call shared function $.sharedDoSomething(); } } jQuery.sharedDoSomething = function() { } Hope that make sense. On Jul 16, 4:38 pm, Harvey scottandrewhar...@gmail.com wrote: I did think of that solution but where would I put functions shared by myImg and myDiv that need access to the $this and tag variables?
[jQuery] Re: 3 Solitaire
I suspect that if the type is left off it assumes that it's javascript. nice templating engine On 15 July, 12:02, Brett Ritter swift...@swiftone.org wrote: On Wed, Jul 15, 2009 at 12:42 AM, Karl Swedbergk...@englishrules.com wrote: Interesting view about this from Douglas Crockford: ... language in all browsers has been JavaScript. In XHTML, this attribute is required and unnecessary. In HTML, it is better to leave it out. The browser knows what to do. That is interesting. I wonder why it is better to leave it out, even if the default works? As a general rule I always thought there is nothing wrong with explicit, particularly if it is non-onerous, and even more so on something regularly changing, such as Web practices. And how would this interact with Resig's advice to use unknown script types to stick content into the page that would not be displayed/read/used/etc by default? I just discovered that trick and was hoping that would provide me the final solution to not including a lot of markup in my JS. http://ejohn.org/blog/javascript-micro-templating/ -- Brett Ritter / SwiftOne swift...@swiftone.org
[jQuery] Re: (Validation) How to submit a form without validating
Thanks Jörn , this is exactly what I need. On Jul 16, 12:57 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: You can add a class=cancel to that button B. The plugin will then skip the validation. Jörn On Thu, Jul 16, 2009 at 9:05 AM, mnaveedmnaveed...@gmail.com wrote: Hi, I am using the Jquery validationss plugin for my form validations. Now I have a situation where I have two submit buttons in a single form (say button A and button B). For button A, I want to run validations but for button B I don't want to run the validations and submit the form without validating.. How can i do this? Thanks.
[jQuery] Re: if button clicked then do this else do that
you mean you have 2 buttons, both with a click event bound to them via the .saveButton class assignment and you want to know which one you clicked? maybe give them ids and test this.attr(id) ? On Jul 16, 7:46 am, Sanam kcssm2...@gmail.com wrote: Hello, I am trying to do something like this. if a button is clicked call one function $('.saveButton').click(function(){ call one function }); else call another function. But I don't have any idea how to implement if else in a clicked event. Can any one help me?
[jQuery] Re: Detecting a redirect response to an Ajax query
2009/7/15 candlerb b.cand...@pobox.com: The login page gets inserted into the DOM, so I know the client must be chasing the redirect and I must be getting either success or notmodified in status. Looking at jQuery source, this comes from xhr.status (in function httpSuccess) which gives success for 2xx or 304, so any 3xx redirect code must have been followed and lost. I can check for xhr? at the server side, and if so, instead of redirecting to the login page I can send back some sort of uncommon HTTP error which can be detected, e.g. 410 Gone, or a custom HTTP header. I'll have a play along those lines. The XMLHttpRequest object transparently follows 3xx redirect responses, so your idea of detecting the situation on the server is the way to go. As James has pointed out, the X-Requested_With header is your best bet. If you intend to send a client error code then you're probably best with 403 Forbidden [1]; then you can include an appropriate message for the user, with a link to the login page, as the body of the response (aka the entity): If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. It's slightly stretching the interpretation of The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated to use 403 in this case, but I think it can be justified, in that the application is being told not to attempt authorization, and can instead inform the user that _they_ will have to attempt authorization by logging back in to start a new session. You might also consider adding a query string parameter to the login link (e.g. the id of the expired session) that allows the application to be re-initialised to the state it was in at the time of the failed Ajax request once the user has established the new session, as this will make things a bit easier on the user. On the other hand, this may be unnecessary, overkill, or just too complex to be worth doing, depending on your application. Regards, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/
[jQuery] Re: Detecting a redirect response to an Ajax query
2009/7/16 Nick Fitzsimons n...@nickfitz.co.uk: 403 Forbidden [1] Oops, forgot the link :-( [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4 -- Nick Fitzsimons http://www.nickfitz.co.uk/
[jQuery] jquery ui dialog get element from button
Hi, I have probably a simple question which i cannot seem to find the answer to. I have a series of images which i want to use as buttons to trigger a dialog. Inside this dialog i need the ID of the image button (or any other element). But it seems after I load the dialog i cannot alter the content of it anymore. As an example I have tried to change the title of the #dialog so it will show the updated title when i click the button. The only way i am able to do this is when i put all of this inside the .click function and start with .attr function followed by the .dialog function. The problem is when i do this and close the dialog i cannot enable the dialog anymore. I guess this is why they have the .dialog(open). Is there a way i can achieve what I'm trying to do here? Maybe there is a better way of doing this? Tia, Carlo code: $(document).ready(function(){ $(.button).click(function(event){ $(#dialog).attr(title, event.target.id); $(#dialog).dialog({ autoOpen:true, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {}, Cancel: function() {$(this).dialog(close);} } }); }); }); div id=dialog title=i did not changethis is a test/div
[jQuery] Re: jquery ui dialog get element from button
Yes that is correct you need to separate the dialog from the open like this note: I set the autoOpen to false. [code] $(document).ready(function(){ $(.button).click(function(event){ $(#dialog).attr(title, event.target.id); $('#dialog').dialog('open'); }); $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {}, Cancel: function() {$(this).dialog(close);} } }); }); [/code] let me know how that works out for you Mean Mike On Jul 16, 8:31 am, Carlo Landmeter clandme...@gmail.com wrote: Hi, I have probably a simple question which i cannot seem to find the answer to. I have a series of images which i want to use as buttons to trigger a dialog. Inside this dialog i need the ID of the image button (or any other element). But it seems after I load the dialog i cannot alter the content of it anymore. As an example I have tried to change the title of the #dialog so it will show the updated title when i click the button. The only way i am able to do this is when i put all of this inside the .click function and start with .attr function followed by the .dialog function. The problem is when i do this and close the dialog i cannot enable the dialog anymore. I guess this is why they have the .dialog(open). Is there a way i can achieve what I'm trying to do here? Maybe there is a better way of doing this? Tia, Carlo code: $(document).ready(function(){ $(.button).click(function(event){ $(#dialog).attr(title, event.target.id); $(#dialog).dialog({ autoOpen:true, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {}, Cancel: function() {$(this).dialog(close);} } }); }); }); div id=dialog title=i did not changethis is a test/div
[jQuery] Accordion with dynamic loading data
Hello I am needing an accordion with dynamic data loading on each tier. Does anyone have a good example of this. I thought I would ask before I took the dive. Thanks, TS
[jQuery] Re: :contains selector not working in IE
This is apparently a bug in 1.3.2. I have reverted to 1.2.6 until its fixed. On Jul 15, 4:15 pm, n0ah jku...@gmail.com wrote: I have the following code working in FF but not IE: function processSearchResult(xData, status){ var resultHTML = ; if (status == success) { $(xData.responseXML).find(QueryResult).each(function() { var x = $(xml + $(this).text() + /xml); x.find(Document).each(function(){ var title = $(PropertiesPropertyName:contains('TITLE'), $ (this)).next().next().text(); var url = $(ActionLinkUrl, $(this)).text(); var title never gets set unless I take out the :contains. Any idea how to solve this issue? -j
[jQuery] Re: $(document).unload() does not fire.
did you try $(window).unload( function(){ }) ; ? On Jul 16, 9:04 am, Nitin nitins.shu...@gmail.com wrote: Hello, I am extensively using jquery.ajax calls to display data on my web page (which build using partial rendering). In certain navigation flow a user move from one page to another. Before he moves I need to capture information filled in by user in first page(form) and save it in java script variable. Since my complete page is built using partial rendering the first form gets unloaded and new form gets loaded making ajax call. In order to capture the data user has filled in first form I have tried to use $(document).unload, $.unload(), $(#form_id).unload() (form_id is the id of the form in the page) to update the java script variable with user's input for form1. But neither scenario my call back function gets fired. I am not sure if I unload will be corrent event to add callback function to update user input. Any pointers and help on how to make my callback function fire will be appreciated. Thanks n Regards, Nitin
[jQuery] How to remove default click behavior when double-clicking?
Hi guys, I'm wondering how to remove default click behavior of an a which is the parent of an img, when double clicking on the parent div? What I would like to achieve is that a user can edit the image when double- clicking on it (lightbox) and just follow the link when simply clicking on it. Thanks! tripleL
[jQuery] Tablesorter sort all / sort current.
I'm using tablesorter to display a list of my search results. I want to be able to sort the viewable results or (depending on whether a checkbox is checked) go back to my app and sort all of the results. For example, say I have 2 columns. columnA and columnB. The user performs a search and finds 1000 records. (I obviously dont want to load all of these for performace resaons) So I show the top 20 search results which are initially sorted by columnA. If the user then decides to sort by columnB tablesorter will sort these 20 results, however I want a way to override this behaviour and select the top 20 results from the 1000 found ordered by columnB. ie I want the option of getting back to my app when the header is clicked instead of just sorting the viewable results. Is there some sort of 'beforeSort' method I can call, similar to JQuery Form's 'beforeSubmit' property? -- View this message in context: http://www.nabble.com/Tablesorter-sort-all---sort-current.-tp24511276s27240p24511276.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] [autocomplete] How to send the partial word typed by user to ajax url?
Hello Gurus, Is it possible to send the partial word typed by user to ajax url in bassistance.de/jquery-plugins/jquery-plugin-autocomplete/? This will help me to use the sql syntax - select abc from tab_name where abc like %user_word% and limit the results to speed up. Also, I have a select drop down. I want to pass on the value of currently selected item (e.g. country) to the ajax url. How can I do this? Thanks.
[jQuery] Problem in the autocomplete functionality in jquery
Hai, I have one email sending section. the can be fully worked on the basis of the ajax functionality. But I dont need to create the instance of the autocomplete in the $(document).ready(); Because my need is to create the instance of the autocomplete after the completion of the login.My login is working on the basis of ajax functionality.After the login, the email section div will come without refresh the page.I need to create the instance of the autocomplete in this time. I am trying for creating the instance of the autocomplate in the keyup .But this is not work properly. The following plugin i have used for this autocomplete, http://docs.jquery.com/Plugins/Autocomplete here is my code sample, var path = base_url+'/affiliates/auto_complete_contact'; var resText = $.ajax({ type:POST, url:path, async:false }).responseText; if(resText != failed){ var data = resText.split(,); $(#share_contact).autocomplete(data,{multiple: true,mustMatch: true,autoFill: true}); }
[jQuery] General information -To get selected index of SELECT (list) using jQuery
Jquery selectedindex Need to remember that JQuery returns an array of matching elements, even if you use the '#' selector that returns only one elements based on the ID. So to find the selectedIndex of a list: function Method() { var index = $('#myList')[0].selectedIndex; };
[jQuery] jquery unchecking checkbox?
Hi all I'm implementing the standard select all/none functionality for table rows and got this problem that i can't overcome. I use this code snippet to do selection: $(selAll, tableSelector).toggle( function(e) { $('input[type=checkbox]', tableSelector).attr('checked', 'checked'); }, function() { $('input[type=checkbox]', tableSelector).removeAttr('checked'); } ); selAll is selector for checkbox that should select all/none checkboxes in table, tableSelector is... well... table selector. However i noticed that each time i click on selAll checkbox, it stays unchecked. Debugging on Firefox (using Firebug's debugger) shows that unchecking gets executed after the first toggle function is left (the checkbox gets checkedbefore the only line of code in that function). Any pointers are much appreciated!
[jQuery] Treeview plugin for navigation - solution
I just thought I'd post a solution I came up with that may be helpful to anyone using the treeview plugin for navigation. The problem I ran into was that the cookie persistence was working, but since I was using the tree for navigation to different directories of my site, sometimes the cookie wouldn't get set correctly and the state of the tree would end up being one step behind what the user had just clicked -- so the previously clicked node would be expanded rather than the current one. Thanks to some helpful posts I found on here, I discovered that the problem was the cookie path. The solution is to use an (undocumented) option that was added to the plugin as of version 1.4: 'cookieOptions', which lets you set the cookie path. If your navigation tree could potentially be used for any page in your domain, then you would set the cookie path to the root, like this: cookieOptions: {path: '/'} ..or if your site is in a subdirectory you should use this: cookieOptions: {path: '/my_subdirectory/'} In my case I'm using PHP and I have my site root stored in a constant called WEB_ROOT, so my full code was: $(document).ready(function() { $(#sideNav ul).treeview({ collapsed: true, unique: true, persist: cookie, cookieOptions: {path: '?= WEB_ROOT ?'} }); }); Hope this is helpful to somebody.
[jQuery] Re: Firefox 3.5 and same-site requests?
I'm getting a lot of the follwoing when sending AJAX request back to the server. onreadystatechange FAILS Error: Permission denied for http:// bpcxp021 to call method UnnamedClass.handleEvent Error: Permission denied for http://bpcxp021 to call method UnnamedClass.handleEvent [xpconnect wrapped nsIDOMEventListener]
[jQuery] Re: .click doesn't seem to respond to elements added with jQuery
try to use the .live method with the click listener blcArmadillo wrote: I'm working on creating a little suggestion/autocomplete code for form fields. Here is the code I currently have written: $(document).ready(function() { $(#city).keyup(function() { $.getJSON(http://iburris.ath.cx/autosuggest/city/+$(#city).val(), function(data) { if (data == ) { $(#results).css(display, none); } else { results = ul; $.each(data, function(i, item) { results += li class=\autosuggest_results_item\ title=\+item.city+, +item.state+\+item.city+, +item.state+/li; }); results += /ul; $(#results).html(results); $(#results).css(display, block); } }); }); $(.autosuggest_results_item).click(function() { $(#city).val($(this).attr(title)); }); }); Now if I just put in my html something like: li class=autosuggest_results_item title=fooFoo/li Everything works fine and when I click on the text Foo the form field value is set to foo. But, when I try clicking on a word added to the page by the keyup part of my code above it doesn't work. Even though if you look at the source everything is the same. Hopefully you guys understand my problem. If not ask for clarification and I'll do my best to answer your questions. Thanks for your help. -- View this message in context: http://www.nabble.com/.click-doesn%27t-seem-to-respond-to-elements-added-with-jQuery-tp24508422s27240p24510502.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Binding Events on a Click
Hello, as a complete beginner in the world of jQuery I'm struggling both with the concept and coding of what I am trying to achieve and would appreciate any help you guys can offer :-) I'd like to have a hyperlink on a page, that when clicked reveals some hidden text below the hyperlink AND at the same time opens a new browser window to a specified URL (which would have been declared in the HTML code NOT the jQuery bind code). There will be several of these 'Click here to reveal password and open site' hyperlinks on the page. Will this scenario cause a problem in the sense that if you click on one hyperlink then all of the reveals would be triggered and numerous windows would be opened? Is this possible? Many thanks for your time and any advice you can give me :-)
[jQuery] (validate) Display default validation errors, not title
Is there a way of telling the validation plug-in to use it's default error messages when the title on the control is set? The default validation error messages are good for most of my cases so I'd rather not have to explicitly set the messages for each and every one of them. For example, if I attach a required validation rule to a textbox and set its title to something, I don't want that title to appear as the error message when they leave the field blank and I'd rather not have to explicitly set the validation message. Is this possible or am I out of luck? Thanks, -Paul
[jQuery] how to get the response header of an ajax request
Hello I want to access the headers of pages I load through ajax. However I don't know how to do this with jQuery First of all, I'm only interested in the headers, not its content, so $('#someID').load(somefile.html) ; is not really what I want. Is there a way I can get the XMLHttpRequest object so I can do xmlDoc.getAllResponseHeaders() Thnx in advance
[jQuery] Autocomplete --- Flickering Problem
Whenever I try to type something into the textbox with Autocomplete activated it gives me a flickering effect in IE and Firefox. Please help me solve this problem.
[jQuery] data: $(#contact_form).serialize(),
Hi guys, I need to send the whole form to the server for processing. I have this now, which is not working: $.ajax({ type: POST, url: file.php, data: $(#contact_form).serialize(), success: function(data){ alert('ok'); } }); Please let me what's wrong and how to fix it. Thanks.
[jQuery] BUG: fadeIn callback gives error!
hey =) here is my code function fadeInFeaturedGame() { $(#featuredgame).fadeIn(slow, setTimeout(fadeOutFeaturedGame(), 5000)); } function fadeOutFeaturedGame() { $(#featuredgame).fadeOut(slow, fadeInFeaturedTvShow()); } function fadeInFeaturedTvShow() { $(#featuredtvshow).fadeIn(slow, setTimeout(fadeOutFeaturedTvShow (), 5000)); } function fadeOutFeaturedTvShow() { $(#featuredtvshow).fadeOut(slow, fadeInFeaturedMovie()); } function fadeInFeaturedMovie() { $(#featuredmovie).fadeIn(slow, setTimeout(fadeOutFeaturedMovie (), 5000)); } function fadeOutFeaturedMovie() { $(#featuredmovie).fadeOut(slow, fadeInFeaturedMovie()); } $(document).ready(function() { $(#featuredgame, #featuredtvshow, #featuredmovie).hide(); fadeInFeaturedGame(); }); and it gives this error (thanks ffx): o.easing[this.options.easing || (o.easing.swing ? swing : linear)] is not a function [...]js/jquery.js Line 19 ??? am i doing something wrong here???
[jQuery] help w/ plugin
I have created a plugin called replaceClass, found at http://plugins.jquery.com/project/replaceClass. However, this works only on hover and I would like to broaden the trigger to include more events. Also, it would be nice to work with id's as well. Any help is appreciated and I am happy to move the code to a site like github if that helps. But more importantly, I wonder if this functionality already exists in jQuery. I created the plugin (my first, btw) because I could not find a built-in way to achieve class replacement on hover. (Btw, I posted this today in the jQuery Plugins groups, but it appears to be dormant.)
[jQuery] Re: jquery ui dialog get element from button
dialog has a setter option for title, it isn't really a title attiribute. The dialog "title is actually a span with class ui-dialog-title-dialog http://jqueryui.com/demos/dialog/#option-title $('.selector').dialog('option', 'title', 'Dialog Title'); either pass the id into the option or you can use $(".button").click(function(event){ $('#dialog').dialog('open'); $('. ui-dialog-title-dialog ').text($(this).attr("id")); }); constructor must be separate as Mike pointed out Mean Mike wrote: Yes that is correct you need to separate the dialog from the open like this note: I set the autoOpen to false. [code] $(document).ready(function(){ $(".button").click(function(event){ $("#dialog").attr("title", event.target.id); $('#dialog').dialog('open'); }); $("#dialog").dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: "#000",opacity: 0.5}, resizable:false, buttons:{ "Delete": function() {}, "Cancel": function() {$(this).dialog("close");} } }); }); [/code] let me know how that works out for you Mean Mike On Jul 16, 8:31am, Carlo Landmeter clandme...@gmail.com wrote: Hi, I have probably a simple question which i cannot seem to find the answer to. I have a series of images which i want to use as buttons to trigger a dialog. Inside this dialog i need the ID of the image button (or any other element). But it seems after I load the dialog i cannot alter the content of it anymore. As an example I have tried to change the title of the #dialog so it will show the updated title when i click the button. The only way i am able to do this is when i put all of this inside the .click function and start with .attr function followed by the .dialog function. The problem is when i do this and close the dialog i cannot enable the dialog anymore. I guess this is why they have the .dialog("open"). Is there a way i can achieve what I'm trying to do here? Maybe there is a better way of doing this? Tia, Carlo code: $(document).ready(function(){ $(".button").click(function(event){ $("#dialog").attr("title", event.target.id); $("#dialog").dialog({ autoOpen:true, modal:true, overlay: {backgroundColor: "#000",opacity: 0.5}, resizable:false, buttons:{ "Delete": function() {}, "Cancel": function() {$(this).dialog("close");} } }); }); }); div id="dialog" title="i did not change"this is a test/div
[jQuery] Re: how to get the response header of an ajax request
$.ajax({ type: GET, url: my_url, async: false }).getAllResponseHeaders() ; On Jul 16, 11:31 am, jeanluca lca...@gmail.com wrote: Hello I want to access the headers of pages I load through ajax. However I don't know how to do this with jQuery First of all, I'm only interested in the headers, not its content, so $('#someID').load(somefile.html) ; is not really what I want. Is there a way I can get the XMLHttpRequest object so I can do xmlDoc.getAllResponseHeaders() Thnx in advance
[jQuery] Re: Accordion with dynamic loading data
not hard to do , just have to use destroy() each time you change it $("#accordion).accordion('destroy'); create new accordion panels //reconstruct accordion $("#accordion).accordion(); Todd Stuart wrote: Hello I am needing an accordion with dynamic data loading on each tier. Does anyone have a good example of this. I thought I would ask before I took the dive. Thanks, TS
[jQuery] Re: jquery ui dialog get element from button
I didn't realize there was a setter option for that, cool now I can change my code LOL Mean Mike On Jul 16, 9:55 am, Charlie charlie...@gmail.com wrote: dialog has a setter option for title, it isn't really a title attiribute. The dialog title is actually a span with class ui-dialog-title-dialoghttp://jqueryui.com/demos/dialog/#option-title$('.selector').dialog('option', 'title', 'Dialog Title');either pass the id into the option or you can use$(.button).click(function(event){ $('#dialog').dialog('open'); $('.ui-dialog-title-dialog').text($(this).attr(id)); }); constructor must be separate as Mike pointed out Mean Mike wrote:Yes that is correct you need to separate the dialog from the open like this note: I set the autoOpen to false. [code] $(document).ready(function(){ $(.button).click(function(event){ $(#dialog).attr(title, event.target.id); $('#dialog').dialog('open'); }); $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {}, Cancel: function() {$(this).dialog(close);} } }); }); [/code] let me know how that works out for you Mean Mike On Jul 16, 8:31 am, Carlo Landmeterclandme...@gmail.comwrote:Hi, I have probably a simple question which i cannot seem to find the answer to. I have a series of images which i want to use as buttons to trigger a dialog. Inside this dialog i need the ID of the image button (or any other element). But it seems after I load the dialog i cannot alter the content of it anymore. As an example I have tried to change the title of the #dialog so it will show the updated title when i click the button. The only way i am able to do this is when i put all of this inside the .click function and start with .attr function followed by the .dialog function. The problem is when i do this and close the dialog i cannot enable the dialog anymore. I guess this is why they have the .dialog(open). Is there a way i can achieve what I'm trying to do here? Maybe there is a better way of doing this? Tia, Carlo code: $(document).ready(function(){ $(.button).click(function(event){ $(#dialog).attr(title, event.target.id); $(#dialog).dialog({ autoOpen:true, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {}, Cancel: function() {$(this).dialog(close);} } }); }); }); div id=dialog title=i did not changethis is a test/div
[jQuery] Re: ASP.NET Placeholder, JQuery, and live() event
That would probably work except PLACEHOLDER does not translate into HTML tags. Instead, it is an ASP.NET only control that gives PlaceHolder for controls and the such. On Jul 15, 8:21 pm, MorningZ morni...@gmail.com wrote: Don't use asp:PlaceHolder id=Place1 runat=server visible=false because as you noted, .NET does not generate that HTML use asp:PlaceHolder id=Place1 runat=server style=display: none; On Jul 15, 3:42 pm, JoshWithrow bloo...@gmail.com wrote: I have a placeholder that houses controls that starts with it's VISIBILITY set to FALSE. This makes the controls non-existant to JQuery initially. So I found the LIVE() event, and have been trying to get it to work alongside autotab (http://www.lousyllama.com/sandbox/ jquery-autotab) with no luck. Any suggestions? BTW, the commented portions work so long as the controls are loaded with the page. $(document).ready(function() { $('#txtEmployee').live('load', function(){ $(this).autotab({ target:'txtJob', nospace, format:'numeric'}); }); //$('#txtEmployee').autotab({ target:'txtJob', nospace, format:'numeric'}); //$('#txtJob').autotab({ target:'txtSuffix', nospace, format:'numeric', previous:'txtEmployee' }); //$('#txtSuffix').autotab({ target:'txtSeq', nospace, uppercase, format:'alphanumeric', previous:'txtJob' }); //$('#txtSeq').autotab({ target:'btnSubmit', nospace, format:'numeric', previous:'txtSuffix' }); //$('#btnSubmit').autotab({ previous:'txtSeq' }); }); Thanks!
[jQuery] Re: help w/ plugin
not sure if you are aware of this but their is a "switchClass" script in jQueryUI. It also includes a duration so the switch can act as animation. You could analyze code from there to adapt to yours http://jqueryui.com/demos/switchClass/ intrinsi wrote: I have created a plugin called replaceClass, found at http://plugins.jquery.com/project/replaceClass. However, this works only on hover and I would like to broaden the trigger to include more events. Also, it would be nice to work with id's as well. Any help is appreciated and I am happy to move the code to a site like github if that helps. But more importantly, I wonder if this functionality already exists in jQuery. I created the plugin (my first, btw) because I could not find a built-in way to achieve class replacement on hover. (Btw, I posted this today in the jQuery Plugins groups, but it appears to be dormant.)
[jQuery] Re: if button clicked then do this else do that
A click is an EVENT, it either happened or it didn't. If it didn't happen, then the else code that you're talking about would be running constantly and repeatedly. I'm not sure if what you asked for is what you meant, because if a button isn't clicked describes every other moment or event from when the page loads. Can you explain what you want to do ? Sanam wrote: Hello, I am trying to do something like this. if a button is clicked call one function $('.saveButton').click(function(){ call one function }); else call another function. But I don't have any idea how to implement if else in a clicked event. Can any one help me? No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database: 270.13.16/2241 - Release Date: 07/16/09 05:58:00
[jQuery] Re: Binding Events on a Click
Yup, add then click, and use the return value (normally false to stop the HREF triggering) to allow the HREF to continue (i.e. return true in the function) But if you're revealing a password like this, it won't be very secure, because something HIDDEN is still there in the View Source L pinman wrote: Hello, as a complete beginner in the world of jQuery I'm struggling both with the concept and coding of what I am trying to achieve and would appreciate any help you guys can offer :-) I'd like to have a hyperlink on a page, that when clicked reveals some hidden text below the hyperlink AND at the same time opens a new browser window to a specified URL (which would have been declared in the HTML code NOT the jQuery bind code). There will be several of these 'Click here to reveal password and open site' hyperlinks on the page. Will this scenario cause a problem in the sense that if you click on one hyperlink then all of the reveals would be triggered and numerous windows would be opened? Is this possible? Many thanks for your time and any advice you can give me :-) No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database: 270.13.16/2241 - Release Date: 07/16/09 05:58:00
[jQuery] Attaching a jQuery event to a dropdown in an ASP.net Repeater?
Hi, I've got an ASP.net repeater which has an unknown number of rows, that I'm passing as a variable into the client-side code. Each repeater item has two dropdowns in it, one of which I need to attach to a jQuery event to create a cascading dropdown. I've put the change(function() { into a for..next loop, along with the target control. It's not pretty, but it seems logical. Problem I have is whenever the function is called, the ID of the target control is the max value of the loop + 1. Why is my loop variable behaving like a reference type instead of a value type? Why is it even in scope outside the loop? Alternatively, is there a better way to do this? The code: var rows = 4; // this is populated from the server code for (iLoop = 0; iLooprows; iLoop++) { $('#ctl00_repCBSkills_ctl0'+iLoop+'_ddlSkillCategory_ID').change (function() { PopulateSubSkill( 'ctl00_repCBSkills_ctl0'+iLoop+'_ddlSkillSubCategory_ID', $('#' + this.id).val() ); }); } function PopulateSubSkill(target, var) { alert(target); // always returns 'ctl00_repCBSkills_ctl05_ddlSkillSubCategory_ID' (note the 5) } Thanks in advance. Duncan
[jQuery] Design pattern for animate()
I have a small hud-syle control I've built for a project. I'm using the following code to activate a collapse button on the hud, and to resize the hud so that it can accommodate some wide data. $('li.hud-left-tab').click(function() { // First, if the hud is collapsed, slide it down $(#data).slideDown(20); // Next, if it's been expanded, shrink it hud.animate({width : hudWidth_init}, 90); hudChild.css({width: hudWidth_init}); $(#map-filter-popdown-shadow).hide(); }); $('li.hud-center-tab').click(function() { // Perform the same check for this tab $(#data).slideDown(20); hud.animate({width : hudWidth_init+360}, 90); hudChild.css({width: hudWidth_init+360}); $(#map-filter-popdown-shadow).hide(); }); $('img.panel-closure').toggle(function(){ $(this).attr(src,/images/show-panel.png); $('#data').slideToggle(90); }, function() { $(this).attr(src,/images/hide-panel.png); $('#data').slideToggle(90); }); This works really well, and does almost everything I need it to do. The only issue is that when the hud is near the edge of the viewport and the user resizes it, its right edge scoots out of view. What I'd like to do is add some kind of conditional logic that says, if this hud is within X pixels of the right or left edge of the screen, add some right margin either during or after the resize animation happens. I keep trying different ways of doing this, to no avail. Any ideas? Thanks.
[jQuery] Re: Binding Events on a Click
Thanks for the response Liam - at least I now know it's possible :) Trouble is I wouldn't know where to start coding it - do you have any examples you could point me to please? Most of the ones I have found via Google refer only to the 'text reveal' bit of the code - not about how to actually bind the 2nd event (window opening) as well. LOL don't worry, the password reference was just as an example :) Apologies if my questions seem a bit noddy - but I'm way out of my depth here! :( On Jul 16, 3:19 pm, Liam Byrne l...@onsight.ie wrote: Yup, add then click, and use the return value (normally false to stop the HREF triggering) to allow the HREF to continue (i.e. return true in the function) But if you're revealing a password like this, it won't be very secure, because something HIDDEN is still there in the View Source L pinman wrote: Hello, as a complete beginner in the world of jQuery I'm struggling both with the concept and coding of what I am trying to achieve and would appreciate any help you guys can offer :-) I'd like to have a hyperlink on a page, that when clicked reveals some hidden text below the hyperlink AND at the same time opens a new browser window to a specified URL (which would have been declared in the HTML code NOT the jQuery bind code). There will be several of these 'Click here to reveal password and open site' hyperlinks on the page. Will this scenario cause a problem in the sense that if you click on one hyperlink then all of the reveals would be triggered and numerous windows would be opened? Is this possible? Many thanks for your time and any advice you can give me :-) No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.387 / Virus Database: 270.13.16/2241 - Release Date: 07/16/09 05:58:00
[jQuery] Re: Jquery/Javascript Developer - 3 month+ contract - To $50/hr - Custom Jquery Exp
Are you still looking for a person. I might have an ideal lead on a candidate. cody On Wed, Jul 15, 2009 at 2:36 PM, Steve Merrimansmerri...@dpcit.com wrote: We are looking for an advanced Jquery/web developer. Specifically we need someone who has created jquery plugins/custom jquery. This will be a 3 month+ contract position. It will be Monday - Friday 9 am - 5 PM. The location is remote, so you can work from home, or you can work onsite, most prefer to work from home. You must have good communication skills. The rate is up to $50/hr. This is for a Fortune 100 company. You must be located in the United States. Lastly, we offer a $1000 referral bonus if you are unavailable but know someone who is. This is very compelling work and project that will look great on your resume. Please reply back with your Word resume, phone #, and a time I can reach you to discuss further. Thank you and talk soon. Best, Steve Merriman DPC 603-627-5020 x221 603-627-5025 fax smerri...@dpcit.com www.dpcit.com Join Me On LinkedIn http://www.linkedin.com/in/stevemerriman
[jQuery] Re: ASP.NET Placeholder, JQuery, and live() event
yeah, my bad, i skipped over that part... i should have completed by saying asp:PlaceHolder id=Place1 runat=server visible=false to div id=Place1 runat=server style=display: none; gives you a server side control (now it's an HtmlGenericControl instead) to add other controls to, plus you can manipulate those controls from jQuery On Jul 16, 10:03 am, JoshWithrow bloo...@gmail.com wrote: That would probably work except PLACEHOLDER does not translate into HTML tags. Instead, it is an ASP.NET only control that gives PlaceHolder for controls and the such. On Jul 15, 8:21 pm, MorningZ morni...@gmail.com wrote: Don't use asp:PlaceHolder id=Place1 runat=server visible=false because as you noted, .NET does not generate that HTML use asp:PlaceHolder id=Place1 runat=server style=display: none; On Jul 15, 3:42 pm, JoshWithrow bloo...@gmail.com wrote: I have a placeholder that houses controls that starts with it's VISIBILITY set to FALSE. This makes the controls non-existant to JQuery initially. So I found the LIVE() event, and have been trying to get it to work alongside autotab (http://www.lousyllama.com/sandbox/ jquery-autotab) with no luck. Any suggestions? BTW, the commented portions work so long as the controls are loaded with the page. $(document).ready(function() { $('#txtEmployee').live('load', function(){ $(this).autotab({ target:'txtJob', nospace, format:'numeric'}); }); //$('#txtEmployee').autotab({ target:'txtJob', nospace, format:'numeric'}); //$('#txtJob').autotab({ target:'txtSuffix', nospace, format:'numeric', previous:'txtEmployee' }); //$('#txtSuffix').autotab({ target:'txtSeq', nospace, uppercase, format:'alphanumeric', previous:'txtJob' }); //$('#txtSeq').autotab({ target:'btnSubmit', nospace, format:'numeric', previous:'txtSuffix' }); //$('#btnSubmit').autotab({ previous:'txtSeq' }); }); Thanks!
[jQuery] Re: cluetip onMouseOut Stick problem
Try hovering over the link and then move the mouse to the left (without going over the actual cluetip). The cluetip stays active. On Jul 10, 7:43 pm, Karl Swedberg k...@englishrules.com wrote: you're moving over and then to the right of the tooltip? strange. it's working fine for me. which browser are you using? I just tested again in FF3.5 and Safari 4, both Mac. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 10, 2009, at 5:24 PM, Randy wrote: Looking at your demo, jTip Style clueTip, if you move over then and then move the mouse to the right, it still doesn't close the cluetip On Jul 9, 10:54 am, Karl Swedberg k...@englishrules.com wrote: Hi Randy, If I understand your problem correctly, I fixed this last week. The updated version can be found on Github: http://github.com/kswedberg/jquery-cluetip/tree/master I also just now updated the demo. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 8, 2009, at 4:46 PM, Randy wrote: When sticky: true and mouseOutClose: true are set the cluetip doesn't always close when you mouse out. Look at the example on the JQUERY DEMO PAGE: http://plugins.learningjquery.com/cluetip/demo/ Look at jTip Theme, 1. jTip Style clueTip, with slideDown effect and an image placed in the title for closing it, because it's sticky. New: The clueTip will close if you mouse out of it. The only way I can get the cluetip to close is moving the mouse on top of the cluetip. Anyone else have this issue and how to resolve it?
[jQuery] Re: (validate) Display default validation errors, not title
Set the option ignoreTitle: true. I'd rather remove that feature completely, but due to backwards compability, you currently have to opt-out... Jörn On Thu, Jul 16, 2009 at 3:36 AM, paulmpa...@rcs-solutions.com wrote: Is there a way of telling the validation plug-in to use it's default error messages when the title on the control is set? The default validation error messages are good for most of my cases so I'd rather not have to explicitly set the messages for each and every one of them. For example, if I attach a required validation rule to a textbox and set its title to something, I don't want that title to appear as the error message when they leave the field blank and I'd rather not have to explicitly set the validation message. Is this possible or am I out of luck? Thanks, -Paul
[jQuery] Re: Design pattern for animate()
use width() and offset in an if statement var pageWidth = $(document).width(); var hudOffset = hud.offset(); if ( pageWidth - hudOffset.left 360 ) { hud.animate({left:-360}, 90); } else { return false; } I'm guessing you'd need something like that. littlerobothead wrote: I have a small hud-syle control I've built for a project. I'm using the following code to activate a collapse button on the hud, and to resize the hud so that it can accommodate some wide data. $('li.hud-left-tab').click(function() { // First, if the hud is collapsed, slide it down $(#data).slideDown(20); // Next, if it's been expanded, shrink it hud.animate({width : hudWidth_init}, 90); hudChild.css({width: hudWidth_init}); $(#map-filter-popdown-shadow).hide(); }); $('li.hud-center-tab').click(function() { // Perform the same check for this tab $(#data).slideDown(20); hud.animate({width : hudWidth_init+360}, 90); hudChild.css({width: hudWidth_init+360}); $(#map-filter-popdown-shadow).hide(); }); $('img.panel-closure').toggle(function(){ $(this).attr(src,/images/show-panel.png); $('#data').slideToggle(90); }, function() { $(this).attr(src,/images/hide-panel.png); $('#data').slideToggle(90); }); This works really well, and does almost everything I need it to do. The only issue is that when the hud is near the edge of the viewport and the user resizes it, its right edge scoots out of view. What I'd like to do is add some kind of conditional logic that says, if this hud is within X pixels of the right or left edge of the screen, add some right margin either during or after the resize animation happens. I keep trying different ways of doing this, to no avail. Any ideas? Thanks.
[jQuery] Re: Design pattern for animate()
Thanks, that worked really well. I was unaware of the offset function; good stuff! On Jul 16, 11:38 am, Liam Potter radioactiv...@gmail.com wrote: use width() and offset in an if statement var pageWidth = $(document).width(); var hudOffset = hud.offset(); if ( pageWidth - hudOffset.left 360 ) { hud.animate({left:-360}, 90); } else { return false; } I'm guessing you'd need something like that. littlerobothead wrote: I have a small hud-syle control I've built for a project. I'm using the following code to activate a collapse button on the hud, and to resize the hud so that it can accommodate some wide data. $('li.hud-left-tab').click(function() { // First, if the hud is collapsed, slide it down $(#data).slideDown(20); // Next, if it's been expanded, shrink it hud.animate({width : hudWidth_init}, 90); hudChild.css({width: hudWidth_init}); $(#map-filter-popdown-shadow).hide(); }); $('li.hud-center-tab').click(function() { // Perform the same check for this tab $(#data).slideDown(20); hud.animate({width : hudWidth_init+360}, 90); hudChild.css({width: hudWidth_init+360}); $(#map-filter-popdown-shadow).hide(); }); $('img.panel-closure').toggle(function(){ $(this).attr(src,/images/show-panel.png); $('#data').slideToggle(90); }, function() { $(this).attr(src,/images/hide-panel.png); $('#data').slideToggle(90); }); This works really well, and does almost everything I need it to do. The only issue is that when the hud is near the edge of the viewport and the user resizes it, its right edge scoots out of view. What I'd like to do is add some kind of conditional logic that says, if this hud is within X pixels of the right or left edge of the screen, add some right margin either during or after the resize animation happens. I keep trying different ways of doing this, to no avail. Any ideas? Thanks.
[jQuery] Re: Attaching a jQuery event to a dropdown in an ASP.net Repeater?
Hi.. When working with ASP.NET controllers I always see the hltml code generated because I can figure out where to inject my jquery code. - Original Message - From: Dunc duncan.we...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, July 16, 2009 8:28 AM Subject: [jQuery] Attaching a jQuery event to a dropdown in an ASP.net Repeater? Hi, I've got an ASP.net repeater which has an unknown number of rows, that I'm passing as a variable into the client-side code. Each repeater item has two dropdowns in it, one of which I need to attach to a jQuery event to create a cascading dropdown. I've put the change(function() { into a for..next loop, along with the target control. It's not pretty, but it seems logical. Problem I have is whenever the function is called, the ID of the target control is the max value of the loop + 1. Why is my loop variable behaving like a reference type instead of a value type? Why is it even in scope outside the loop? Alternatively, is there a better way to do this? The code: var rows = 4; // this is populated from the server code for (iLoop = 0; iLooprows; iLoop++) { $('#ctl00_repCBSkills_ctl0'+iLoop+'_ddlSkillCategory_ID').change (function() { PopulateSubSkill( 'ctl00_repCBSkills_ctl0'+iLoop+'_ddlSkillSubCategory_ID', $('#' + this.id).val() ); }); } function PopulateSubSkill(target, var) { alert(target); // always returns 'ctl00_repCBSkills_ctl05_ddlSkillSubCategory_ID' (note the 5) } Thanks in advance. Duncan
[jQuery] Re: Treeview plugin for navigation - solution
Sorry for the repeat posts, but the link above was incorrect (I'm at a different computer right now). This is the revision I used: http://dev.jquery.com/browser/trunk/plugins/treeview/jquery.treeview.js?rev=4685 ...although there appear to be more recent revisions...I'm not sure which is best. On Jul 16, 12:06 pm, Matt B. mbrown...@gmail.com wrote: Edit: I realized that cookieOptions is actually a version 1.4.1 feature, only available from the SVN. The feature has not yet been added to the minified version, so you need to grab the uncompressed version here: http://dev.jquery.com/browser/trunk/plugins/treeview/jquery.treeview.js So it's not undocumented, it's just that 1.4.1 hasn't officially been released yet. On Jul 16, 8:45 am, Matt B. mbrown...@gmail.com wrote: I just thought I'd post a solution I came up with that may be helpful to anyone using thetreeviewplugin fornavigation. The problem I ran into was that the cookie persistence was working, but since I was using the tree fornavigationto different directories of my site, sometimes the cookie wouldn't get set correctly and the state of the tree would end up being one step behind what the user had just clicked -- so the previously clicked node would be expanded rather than the current one. Thanks to some helpful posts I found on here, I discovered that the problem was the cookie path. The solution is to use an (undocumented) option that was added to the plugin as of version 1.4: 'cookieOptions', which lets you set the cookie path. If yournavigationtree could potentially be used for any page in your domain, then you would set the cookie path to the root, like this: cookieOptions: {path: '/'} ..or if your site is in a subdirectory you should use this: cookieOptions: {path: '/my_subdirectory/'} In my case I'm using PHP and I have my site root stored in a constant called WEB_ROOT, so my full code was: $(document).ready(function() { $(#sideNav ul).treeview({ collapsed: true, unique: true, persist: cookie, cookieOptions: {path: '?= WEB_ROOT ?'} }); }); Hope this is helpful to somebody.
[jQuery] Re: Binding Events on a Click
Option 1 : set the target of the link to _blank, bind the text reveal, and return true so that the natural href triggers Option 2 : bind the text reveal, adding a window.open($(this).attr(href)) to the code L pinman wrote: Thanks for the response Liam - at least I now know it's possible :) Trouble is I wouldn't know where to start coding it - do you have any examples you could point me to please? Most of the ones I have found via Google refer only to the 'text reveal' bit of the code - not about how to actually bind the 2nd event (window opening) as well. LOL don't worry, the password reference was just as an example :) Apologies if my questions seem a bit noddy - but I'm way out of my depth here! :( On Jul 16, 3:19 pm, Liam Byrne l...@onsight.ie wrote: Yup, add then click, and use the return value (normally false to stop the HREF triggering) to allow the HREF to continue (i.e. return true in the function) But if you're revealing a password like this, it won't be very secure, because something HIDDEN is still there in the View Source L pinman wrote: Hello, as a complete beginner in the world of jQuery I'm struggling both with the concept and coding of what I am trying to achieve and would appreciate any help you guys can offer :-) I'd like to have a hyperlink on a page, that when clicked reveals some hidden text below the hyperlink AND at the same time opens a new browser window to a specified URL (which would have been declared in the HTML code NOT the jQuery bind code). There will be several of these 'Click here to reveal password and open site' hyperlinks on the page. Will this scenario cause a problem in the sense that if you click on one hyperlink then all of the reveals would be triggered and numerous windows would be opened? Is this possible? Many thanks for your time and any advice you can give me :-) No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.387 / Virus Database: 270.13.16/2241 - Release Date: 07/16/09 05:58:00 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database: 270.13.16/2241 - Release Date: 07/16/09 05:58:00
[jQuery] Re: Get following rows in a table until id not match certain pattern
if you work with ID's you won't have choice but to use filters, however if you can associate a class matching system when you construct the ID's would simplify filtering tr id="top11_21"tda href="" id="top11_21click" class="class11_21"click here/a/ td...rest of row data/td/tr tr id="act11_21_1" class="class11_21"td.../td/tr tr id="act11_21_2" class="class11_21"td.../td/tr $("td").click(function () { className= $(this).attr("class"); $(this).nextAll(className).show(); }); pantagruel wrote: Hi, I have a situation where a user clicks on something in a particular table row which should cause all following rows in that table that have a particular format of id to toggle visibility.. so for example tr id="top11_21"tda href="" id="top11_21click"click here/a/ td...rest of row data/td/tr tr id="act11_21_1"td.../td/tr tr id="act11_21_2"td.../td/tr tr id="act11_21_30"td.../td/tr tr id="top11_22"tda href="" id="top11_22click"click here/a/ td...rest of row data/td/tr when someone clicks on top11_21click it should toggle the visibility of rows act11_21_1 to act11_21_30 I would like to have this efficient, thus not just a find or filter, but rather something that gets the context of the clicked row and then loops following rows until the input does not match - any suggestions for a jquery like way of handling this?
[jQuery] Re: slideUp(), slideDown() not working in IE 6, 7 on LI elements
Is the best way forward to just rewrite the HTML so that it uses DIV elements instead of UL and LIs? There's got to be a better way... On Jul 15, 2:38 pm, Bill bllfr...@gmail.com wrote: Leonardo, thanks very much for your reply. I've updated my code, so the third wrapper contains the following: div class=wrapper h3Plain ol' UL,slideDown()/h3 ul id=menu-1-fix lidivOne/div/li lidivTwo/div/li lidivThree/div/li lidivFour/div/li lidivFive/div/li /ul /div And the jQuery code: /** * Fix... */ $(#menu-1-fix li div).click(function(e) { $(this).slideUp(2000, function() { $(this).parent().hide(-1).remove(); }); }); But the problem persists inIE. Anyone know when the bug will be fixed? Could I get around the problem using the animate() command? Regards --Bill On Jul 15, 1:34 pm, Leonardo K leo...@gmail.com wrote: You can put a DIV inside a LI and animate the DIV li div content here /div /li On Wed, Jul 15, 2009 at 16:31, Bill bllfr...@gmail.com wrote: Alright, so this *is* a bug: http://dev.jquery.com/ticket/3120 Anyone have any advice on a workaround ? On Jul 15, 12:15 pm, Bill bllfr...@gmail.com wrote: Hi all, I posted a week ago about some odd behavior with slideUp() and slideDown() inIE6, 7, and 8 (the post is here: http://groups.google.com/group/jquery-en/browse_thread/thread/1b4cda0... ). After several hours of further investigation, it appears that jQuery isn't properly animating LI elements. I set up a simplified example here: http://69.59.182.148:4080/test/07152009/index.html The first two examples on this page show slideUp() andslideDown() on LI elements. In Firefox, Chrome, Opera, and Safari, clicking causes slideUp() orslideDown() animations that behave as expected. InIE6 and 7, slideUp() andslideDown() behave very differently. The second two examples basically translate the unordered lists and list items into divs. slideUp() andslideDown() work as expected in these examples, even inIE6 and 7. Is this a flaw in the slideUp()/slideDown() commands? Regards, --Bill
[jQuery] Re: ASP.NET Placeholder, JQuery, and live() event
AAaaahhh yes okay. Now I see where you're going. Thanks! On Jul 16, 10:58 am, MorningZ morni...@gmail.com wrote: yeah, my bad, i skipped over that part... i should have completed by saying asp:PlaceHolder id=Place1 runat=server visible=false to div id=Place1 runat=server style=display: none; gives you a server side control (now it's an HtmlGenericControl instead) to add other controls to, plus you can manipulate those controls from jQuery On Jul 16, 10:03 am, JoshWithrow bloo...@gmail.com wrote: That would probably work except PLACEHOLDER does not translate into HTML tags. Instead, it is an ASP.NET only control that gives PlaceHolder for controls and the such. On Jul 15, 8:21 pm, MorningZ morni...@gmail.com wrote: Don't use asp:PlaceHolder id=Place1 runat=server visible=false because as you noted, .NET does not generate that HTML use asp:PlaceHolder id=Place1 runat=server style=display: none; On Jul 15, 3:42 pm, JoshWithrow bloo...@gmail.com wrote: I have a placeholder that houses controls that starts with it's VISIBILITY set to FALSE. This makes the controls non-existant to JQuery initially. So I found the LIVE() event, and have been trying to get it to work alongside autotab (http://www.lousyllama.com/sandbox/ jquery-autotab) with no luck. Any suggestions? BTW, the commented portions work so long as the controls are loaded with the page. $(document).ready(function() { $('#txtEmployee').live('load', function(){ $(this).autotab({ target:'txtJob', nospace, format:'numeric'}); }); //$('#txtEmployee').autotab({ target:'txtJob', nospace, format:'numeric'}); //$('#txtJob').autotab({ target:'txtSuffix', nospace, format:'numeric', previous:'txtEmployee' }); //$('#txtSuffix').autotab({ target:'txtSeq', nospace, uppercase, format:'alphanumeric', previous:'txtJob' }); //$('#txtSeq').autotab({ target:'btnSubmit', nospace, format:'numeric', previous:'txtSuffix' }); //$('#btnSubmit').autotab({ previous:'txtSeq' }); }); Thanks!
[jQuery] Re: jquery ui dialog get element from button
Thanks for your replies. If I look at your first option I wouldn't know how i could know the correct ID before i click the button but i have to initiate the dialog open after the normal dialog function. You second option seems the best way for me, after the dialog is created i can modify its content with your suggested code. Now I still want to find if i can also load a page with ajax (load) instead of a local div. Thx again, Carlo code: $(document).ready(function(){ $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {}, Cancel: function() {$(this).dialog(close);} } }); $(.button).click(function(event){ $(#dialog).dialog(open); $(#ui-dialog-title-dialog).text($(this).attr(id)); }); });'; div id=dialogthis is a test/div On Thu, Jul 16, 2009 at 3:55 PM, Charliecharlie...@gmail.com wrote: dialog has a setter option for title, it isn't really a title attiribute. The dialog title is actually a span with class ui-dialog-title-dialog http://jqueryui.com/demos/dialog/#option-title $('.selector').dialog('option', 'title', 'Dialog Title'); either pass the id into the option or you can use $(.button).click(function(event){ $('#dialog').dialog('open'); $('. ui-dialog-title-dialog ').text($(this).attr(id)); }); constructor must be separate as Mike pointed out Mean Mike wrote: Yes that is correct you need to separate the dialog from the open like this note: I set the autoOpen to false. [code] $(document).ready(function(){ $(.button).click(function(event){ $(#dialog).attr(title, event.target.id); $('#dialog').dialog('open'); }); $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {}, Cancel: function() {$(this).dialog(close);} } }); }); [/code] let me know how that works out for you Mean Mike On Jul 16, 8:31 am, Carlo Landmeter clandme...@gmail.com wrote: Hi, I have probably a simple question which i cannot seem to find the answer to. I have a series of images which i want to use as buttons to trigger a dialog. Inside this dialog i need the ID of the image button (or any other element). But it seems after I load the dialog i cannot alter the content of it anymore. As an example I have tried to change the title of the #dialog so it will show the updated title when i click the button. The only way i am able to do this is when i put all of this inside the .click function and start with .attr function followed by the .dialog function. The problem is when i do this and close the dialog i cannot enable the dialog anymore. I guess this is why they have the .dialog(open). Is there a way i can achieve what I'm trying to do here? Maybe there is a better way of doing this? Tia, Carlo code: $(document).ready(function(){ $(.button).click(function(event){ $(#dialog).attr(title, event.target.id); $(#dialog).dialog({ autoOpen:true, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {}, Cancel: function() {$(this).dialog(close);} } }); }); }); div id=dialog title=i did not changethis is a test/div
[jQuery] Re: how to get the response header of an ajax request
Using $.ajax(), when you set a 'complete' callback function, the XHR object should be provided for you, which you're able to use to get the response headers. On Jul 16, 3:56 am, jeanluca lca...@gmail.com wrote: $.ajax({ type: GET, url: my_url, async: false }).getAllResponseHeaders() ; On Jul 16, 11:31 am, jeanluca lca...@gmail.com wrote: Hello I want to access the headers of pages I load through ajax. However I don't know how to do this with jQuery First of all, I'm only interested in the headers, not its content, so $('#someID').load(somefile.html) ; is not really what I want. Is there a way I can get the XMLHttpRequest object so I can do xmlDoc.getAllResponseHeaders() Thnx in advance
[jQuery] Re: BUG: fadeIn callback gives error!
The code like: $(#featuredgame).fadeIn(slow, setTimeout(fadeOutFeaturedGame(), 5000)); Should be: $(#featuredgame).fadeIn(slow, function() { setTimeout(fadeOutFeaturedGame, 5000); }); The code like: $(#featuredgame).fadeOut(slow, fadeInFeaturedTvShow()); Should be: $(#featuredgame).fadeOut(slow, fadeInFeaturedTvShow); On Jul 15, 6:44 pm, Garrett G gsquare...@gmail.com wrote: hey =) here is my code function fadeInFeaturedGame() { $(#featuredgame).fadeIn(slow, setTimeout(fadeOutFeaturedGame(), 5000));} function fadeOutFeaturedGame() { $(#featuredgame).fadeOut(slow, fadeInFeaturedTvShow());} function fadeInFeaturedTvShow() { $(#featuredtvshow).fadeIn(slow, setTimeout(fadeOutFeaturedTvShow (), 5000));} function fadeOutFeaturedTvShow() { $(#featuredtvshow).fadeOut(slow, fadeInFeaturedMovie());} function fadeInFeaturedMovie() { $(#featuredmovie).fadeIn(slow, setTimeout(fadeOutFeaturedMovie (), 5000));} function fadeOutFeaturedMovie() { $(#featuredmovie).fadeOut(slow, fadeInFeaturedMovie()); } $(document).ready(function() { $(#featuredgame, #featuredtvshow, #featuredmovie).hide(); fadeInFeaturedGame(); }); and it gives this error (thanks ffx): o.easing[this.options.easing || (o.easing.swing ? swing : linear)] is not a function [...]js/jquery.js Line 19 ??? am i doing something wrong here???
[jQuery] Re: data: $(#contact_form).serialize(),
Could you define not working? Are there any error messages? Is $(#contact_form).serialize() not giving the right values? Is the AJAX request not being sent? Is there no response coming back from the AJAX request? Try adding an 'error' callback also to see if it gets called. On Jul 15, 6:24 pm, robotwink robotw...@gmail.com wrote: Hi guys, I need to send the whole form to the server for processing. I have this now, which is not working: $.ajax({ type: POST, url: file.php, data: $(#contact_form).serialize(), success: function(data){ alert('ok'); } }); Please let me what's wrong and how to fix it. Thanks.
[jQuery] Re: Binding Events on a Click
Here's an example (untested): a href=http://link1.com; class=linkLink 1/a div style=display:noneHidden Text 1/div a href=http://link2.com; class=linkLink 2/a div style=display:noneHidden Text 2/div a href=http://link3.com; class=linkLink 3/a div style=display:noneHidden Text 3/div $(function() { $(.a.link).click(function() { $(this).next('div').show(); // you might have to change .next() depending on how your elements are placed window.open( $(this).attr('href') ); return false; }); }); On Jul 16, 6:59 am, Liam Byrne l...@onsight.ie wrote: Option 1 : set the target of the link to _blank, bind the text reveal, and return true so that the natural href triggers Option 2 : bind the text reveal, adding a window.open($(this).attr(href)) to the code L pinman wrote: Thanks for the response Liam - at least I now know it's possible :) Trouble is I wouldn't know where to start coding it - do you have any examples you could point me to please? Most of the ones I have found via Google refer only to the 'text reveal' bit of the code - not about how to actually bind the 2nd event (window opening) as well. LOL don't worry, the password reference was just as an example :) Apologies if my questions seem a bit noddy - but I'm way out of my depth here! :( On Jul 16, 3:19 pm, Liam Byrne l...@onsight.ie wrote: Yup, add then click, and use the return value (normally false to stop the HREF triggering) to allow the HREF to continue (i.e. return true in the function) But if you're revealing a password like this, it won't be very secure, because something HIDDEN is still there in the View Source L pinman wrote: Hello, as a complete beginner in the world of jQuery I'm struggling both with the concept and coding of what I am trying to achieve and would appreciate any help you guys can offer :-) I'd like to have a hyperlink on a page, that when clicked reveals some hidden text below the hyperlink AND at the same time opens a new browser window to a specified URL (which would have been declared in the HTML code NOT the jQuery bind code). There will be several of these 'Click here to reveal password and open site' hyperlinks on the page. Will this scenario cause a problem in the sense that if you click on one hyperlink then all of the reveals would be triggered and numerous windows would be opened? Is this possible? Many thanks for your time and any advice you can give me :-) No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.387 / Virus Database: 270.13.16/2241 - Release Date: 07/16/09 05:58:00 No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.387 / Virus Database: 270.13.16/2241 - Release Date: 07/16/09 05:58:00
[jQuery] Get the HTML of the current node plus its Inner HTML
Hi, I need to get all the TABLE HTML code within the body tag for a content-generating application. I'm trying to use the html() method, but it only gets the inner HTML. I also tried clone(), but does the same thing. Or maybe I'm using it wrong. Here's an example to clarify what I wanted to do: Input body psome text/p table cellpadding=0 cellspacing=0 style=width: 600px;/ table div.../div table cellpadding=0 cellspacing=0 style=width: 400px;/ table /body Output table cellpadding=0 cellspacing=0 style=width: 600px;/ table table cellpadding=0 cellspacing=0 style=width: 400px;/ table jQuery Code $(body).children().each(function(){ var contentHtml = ; if(this.nodeName.toLowerCase() == table) { //need to include the TABLE code here contentHtml += $(this).html(); } }); Thanks in advance.
[jQuery] Re: Get following rows in a table until id not match certain pattern
If i understand you correctly you can associate a click event to the table, then get the id of the TR clicked, then filter by nextAll('tr[id^=act+id - top].toggle(); something like: $('yourtable').click(function(e){ var id = $(e.target).closest('tr').attr('id'); // Then filter nextAll tr with id }); bryan rasmussen wrote: Hi, I have a situation where a user clicks on something in a particular table row which should cause all following rows in that table that have a particular format of id to toggle visibility.. so for example tr id=top11_21td # click here / td...rest of row data/td/tr tr id=act11_21_1td.../td/tr tr id=act11_21_2td.../td/tr tr id=act11_21_30td.../td/tr tr id=top11_22td # click here / td...rest of row data/td/tr when someone clicks on top11_21click it should toggle the visibility of rows act11_21_1 to act11_21_30 I would like to have this efficient, thus not just a find or filter, but rather something that gets the context of the clicked row and then loops following rows until the input does not match - any suggestions for a jquery like way of handling this? -- View this message in context: http://www.nabble.com/Get-following-rows-in-a-table-until-id-not-match-certain-pattern-tp24519653s27240p24522639.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Attaching a jQuery event to a dropdown in an ASP.net Repeater?
if your DDL has ddlSkillCategoryID as id you can select them with following selectors: $('select[id$=ddlSkillCategoryID]').change(function(){ // do your stuffs }) Dunc-4 wrote: Hi, I've got an ASP.net repeater which has an unknown number of rows, that I'm passing as a variable into the client-side code. Each repeater item has two dropdowns in it, one of which I need to attach to a jQuery event to create a cascading dropdown. I've put the change(function() { into a for..next loop, along with the target control. It's not pretty, but it seems logical. Problem I have is whenever the function is called, the ID of the target control is the max value of the loop + 1. Why is my loop variable behaving like a reference type instead of a value type? Why is it even in scope outside the loop? Alternatively, is there a better way to do this? The code: var rows = 4; // this is populated from the server code for (iLoop = 0; iLooprows; iLoop++) { $('#ctl00_repCBSkills_ctl0'+iLoop+'_ddlSkillCategory_ID').change (function() { PopulateSubSkill( 'ctl00_repCBSkills_ctl0'+iLoop+'_ddlSkillSubCategory_ID', $('#' + this.id).val() ); }); } function PopulateSubSkill(target, var) { alert(target); // always returns 'ctl00_repCBSkills_ctl05_ddlSkillSubCategory_ID' (note the 5) } Thanks in advance. Duncan -- View this message in context: http://www.nabble.com/Attaching-a-jQuery-event-to-a-dropdown-in-an-ASP.net-Repeater--tp24517510s27240p24522762.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: cluetip onMouseOut Stick problem
yes, that's because the cluetip is sticky. The mouseOutClose option works for mousing out of the cluetip, so you basically have two choices there -- click the close link or mouse out of the cluetip. There isn't currently an option for hiding the cluetip when you mouse out of the link without mousing over the cluetip but keeping it open if you move your mouse from the link to the cluetip. I guess it would have to be on a timeout since there is always a gap between the two. You might be able to write your own custom function using $ (document).trigger('hideCluetip') --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 16, 2009, at 11:16 AM, Randy wrote: Try hovering over the link and then move the mouse to the left (without going over the actual cluetip). The cluetip stays active. On Jul 10, 7:43 pm, Karl Swedberg k...@englishrules.com wrote: you're moving over and then to the right of the tooltip? strange. it's working fine for me. which browser are you using? I just tested again in FF3.5 and Safari 4, both Mac. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 10, 2009, at 5:24 PM, Randy wrote: Looking at your demo, jTip Style clueTip, if you move over then and then move the mouse to the right, it still doesn't close the cluetip On Jul 9, 10:54 am, Karl Swedberg k...@englishrules.com wrote: Hi Randy, If I understand your problem correctly, I fixed this last week. The updated version can be found on Github: http://github.com/kswedberg/jquery-cluetip/tree/master I also just now updated the demo. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 8, 2009, at 4:46 PM, Randy wrote: When sticky: true and mouseOutClose: true are set the cluetip doesn't always close when you mouse out. Look at the example on the JQUERY DEMO PAGE: http://plugins.learningjquery.com/cluetip/demo/ Look at jTip Theme, 1.jTip Style clueTip, with slideDown effect and an image placed in the title for closing it, because it's sticky. New: The clueTip will close if you mouse out of it. The only way I can get the cluetip to close is moving the mouse on top of the cluetip. Anyone else have this issue and how to resolve it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to jquery-en+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] jQuery Conference 2009 Registration is Now Open
We're happy to announce that registration for the jQuery Conference 2009 is now open. The yearly event consistently sells out quickly due to the quality of information being presented and speakers in attendance. This year should be no different. The two day conference (Yes it's now 2 days!!!) is taking place Saturday, September 12th and Sunday, September 13th at Microsoft Cambridge in Boston. The registration fee is $150.00(USD) and will help cover the cost of the venue, food and beverages, and a T-Shirt for attendees! Payment for the event is handled via PayPal. To register, go here: http://events.jquery.com/ The conference will be all day and feature two tracks on each day. The schedule is still being finalized and will be announced once it is available. See this blog post for more details! http://blog.jquery.com/2009/07/02/jquery-conference-2009-dates-and-venue/ jQuery Team
[jQuery] Fading background images in and out
Hi, Just wondering what the best way to cycle (fade in and out) background images is? I´ve got to create a homepage with a navigation and nothing else but background images fading in and out behind it. I was going to use the Cycle plugin for Jquery, but it means I need to create a div with images in it and I can´t seem to keep them in the background only (i.e. the z-index doesn't work). Any ideas of how to keep the images only in the backgroun/stop them obscuring other elements on the page? Thanks osu
[jQuery] Re: help w/ plugin
Thanks, I wasn't aware. It seems like it would be good to expand this script, especially to allow for different targets. That is, unless there is already a way to do that. I'll look into it. On Jul 16, 7:11 am, Charlie charlie...@gmail.com wrote: not sure if you are aware of this but their is a switchClass script in jQueryUI. It also includes a duration so the switch can act as animation. You could analyze code from there to adapt to yourshttp://jqueryui.com/demos/switchClass/
[jQuery] Re: Get the HTML of the current node plus its Inner HTML
I was going to work on a proof of concept, but then I had the idea to see if anyone else has already implemented this. Sure enough, Brandon Aaron has: http://brandonaaron.net/blog/2007/06/17/jquery-snippets-outerhtml http://brandonaaron.net/blog/2007/06/17/jquery-snippets-outerhtml Ted On Thu, Jul 16, 2009 at 3:06 PM, bittermonkey brakes...@gmail.com wrote: Hi, I need to get all the TABLE HTML code within the body tag for a content-generating application. I'm trying to use the html() method, but it only gets the inner HTML. I also tried clone(), but does the same thing. Or maybe I'm using it wrong. Here's an example to clarify what I wanted to do: Input body psome text/p table cellpadding=0 cellspacing=0 style=width: 600px;/ table div.../div table cellpadding=0 cellspacing=0 style=width: 400px;/ table /body Output table cellpadding=0 cellspacing=0 style=width: 600px;/ table table cellpadding=0 cellspacing=0 style=width: 400px;/ table jQuery Code $(body).children().each(function(){ var contentHtml = ; if(this.nodeName.toLowerCase() == table) { //need to include the TABLE code here contentHtml += $(this).html(); } }); Thanks in advance.
[jQuery] Re: Fading background images in and out
Using z-index seems like the way to go. If you show us the code that didn't work, maybe we can help you figure out why it didn't. Ted On Thu, Jul 16, 2009 at 4:17 PM, osu onesiz...@googlemail.com wrote: Hi, Just wondering what the best way to cycle (fade in and out) background images is? I´ve got to create a homepage with a navigation and nothing else but background images fading in and out behind it. I was going to use the Cycle plugin for Jquery, but it means I need to create a div with images in it and I can´t seem to keep them in the background only (i.e. the z-index doesn't work). Any ideas of how to keep the images only in the backgroun/stop them obscuring other elements on the page? Thanks osu
[jQuery] Re: Doing something before the get request
It's done! You were very helpful. Thank you James On Jul 15, 7:06 pm, James james.gp@gmail.com wrote: You can find the information on jQuery's documentation website. Here's the AJAX page:http://docs.jquery.com/Ajax Click on the jQuery.ajax(options) link and then the options tab to view available options you can set. On Jul 15, 4:10 am,FabioMilheirofabiomilhe...@gmail.com wrote: Thank you, but can I insert the parameters. I couldn't find that information anywhere else. Could you please tell me or indicate where I can see that. Regards On Jul 15, 3:16 am, James james.gp@gmail.com wrote: $.ajax({ url: 'file.html', type: 'get', beforeSend: function() { // add loading image }, success: function(data) { (#msg).html(data); }, error: function() { alert('something bad happened...'); } }); On Jul 14, 11:05 am,FabioMilheirofabiomilhe...@gmail.com wrote: This example is not clear enough (at least for me..)http://docs.jquery.com/Ajax/ajaxSend I want something simple such as the user clicking and a waiting.gif image is presented in order to let the user know that the server is working on it. $.get(file.html, function(data){ $(#msg).html(data); }); How do I get the ajaxSend to work with the above code (above code is working). Thank you
[jQuery] Re: Get the HTML of the current node plus its Inner HTML
each time that you need javascript function you can use [0] or 'this' in your case you can get it by if(this.nodeName.toLowerCase() == table) { contentHtml += this.outerHTML(); } or if have already selected your table, $table = $('selector') use $table[0].outerHTML bittermonkey wrote: Hi, I need to get all the TABLE HTML code within the body tag for a content-generating application. I'm trying to use the html() method, but it only gets the inner HTML. I also tried clone(), but does the same thing. Or maybe I'm using it wrong. Here's an example to clarify what I wanted to do: Input body psome text/p table cellpadding=0 cellspacing=0 style=width: 600px;/ table div.../div table cellpadding=0 cellspacing=0 style=width: 400px;/ table /body Output table cellpadding=0 cellspacing=0 style=width: 600px;/ table table cellpadding=0 cellspacing=0 style=width: 400px;/ table jQuery Code $(body).children().each(function(){ var contentHtml = ; if(this.nodeName.toLowerCase() == table) { //need to include the TABLE code here contentHtml += $(this).html(); } }); Thanks in advance. -- View this message in context: http://www.nabble.com/Get-the-HTML-of-the-current-node-plus-its-Inner-HTML-tp24522580s27240p24524640.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Create a Select Box
So ive got a fun page where I need to create the dropdowns based on an array I pass into the html. (coming form php) However I cant figure out how to actually create a select box... I can however populate a select box that exists... Before Jquery does its stuff ul id=filter/ul So heres what I need the end to look like after jquery has run its stuff ul id=filter li id=select_1select name=select_1 class=filteroption value=11/option/select/li li id=select_2select name=select_2 class=filteroption value=11/option/select/li /ul
[jQuery] Re: Disabling Button in jQuery HTML Form Plugin
still looking for help with this...thanks On Jul 8, 1:36 pm, icuucme deron.tava...@gmail.com wrote: I am currently using this pluginhttp://www.malsup.com/jquery/form/#code-samples (HTML) to display a div with content, depending on what is entered. Is there a way to disable the submit button if the div contains a certain message?
[jQuery] Re: Disabling Button in jQuery HTML Form Plugin
you can check the message in the onclick event... - Original Message - From: icuucme deron.tava...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, July 16, 2009 4:37 PM Subject: [jQuery] Re: Disabling Button in jQuery HTML Form Plugin still looking for help with this...thanks On Jul 8, 1:36 pm, icuucme deron.tava...@gmail.com wrote: I am currently using this pluginhttp://www.malsup.com/jquery/form/#code-samples (HTML) to display a div with content, depending on what is entered. Is there a way to disable the submit button if the div contains a certain message?
[jQuery] Re: Create a Select Box
I don't know the structure of your data coming from your server, but generally speaking you should do something like : var $sel = $('select name=select_1 class=filter/select.'); now loop from your array and populate your select $sel.append($('option value='+ value + '' + text +'/option'); once you get your select compete then append it to ul $('ul#filter').append($sel); tdktan...@gmail.com wrote: So ive got a fun page where I need to create the dropdowns based on an array I pass into the html. (coming form php) However I cant figure out how to actually create a select box... I can however populate a select box that exists... Before Jquery does its stuff ul id=filter/ul So heres what I need the end to look like after jquery has run its stuff ul id=filter li id=select_1select name=select_1 class=filteroption value=11/option/select/li li id=select_2select name=select_2 class=filteroption value=11/option/select/li /ul -- View this message in context: http://www.nabble.com/Create-a-Select-Box-tp24525251s27240p24525842.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jQuery UI Tabs and Ajax
Hi together, I give the question in UI Group but nobody answer there: I'm really new to jQuery and UI. What I'm trying is to build a view in CakePHP with the jQuery UI Tabs. The first part, integration the informations from my Cake controller in Tab 1 to 4 and is working. In Tab 5 and Tab 6 I want to show informations which are in relation to the dataset of Tab1 to Tab4. I.e. I'm calling a Post-View. In Tab 5 I want to show the attachements (1 : n relation). So I do the following: div id=tabs ul lia href=#tab-1span?php echo __('Details'); ?/span/ a/li lia href=#tab-2span?php echo __('Fittings'); ?/ span/ a/li lia href=#tab-3span?php echo __('Conditions'); ?/ span/a/li lia href=#tab-4span?php echo __('Partner'); ?/span/ a/li lia href=/admin/attachements/getlist/?php echo $this-data ['Posts']['id]; ?span?php echo __('Object attachements'); ?/ span/a/li /ul I think I have to tell the object, that the fiftht tab is an ajax call. But I don't know how to mix them: script type=text/javascript $(function() { $(#tabs).tabs(); $('#tabs').tabs({ remote: true }); }); /script The coding above is wrong - I know. I have read that it should be possible to mix normal tabs with ajax. But how? Have anybody an idea for me? Regards Thomas
[jQuery] show dynamic changes when a refresh occurs
Hi, I have a moderate level of experience with javascript, and a good oo background. So, when I tried jquery I'm really liking it. I have a requirement to add input fields dynamically to the form since I don't know ahead of time how many entries the user may request. I was able to implement this with jquery very quickly with a small amount of code. When the form is submitted it is sent to the server with all of the data correctly passed. However, if I do a refresh, the dynamic fields go away, but the static fields still have data in them so I assuming that the dynamic data is still there. How can I verify this? When I show source, it only shows the original code; same even before the form is submitted. Is there a way to stop a refresh? This application may have 10 added fields or 300 added fields, and if the user does a refresh for some reason he'll want to see every thing that has been input so far. my code: $(document).ready(function() { $(#divBoxes input:last).bind(change, appendBoxField); $(#divBags input:last).bind(change, appendBagField); }); function appendBoxField() { var len = $(#divBoxes input).length + 1; //alert(len); $(#divBoxes).append('input type=text name=_UPS_Shipping_Label_' + len + ' /') $(this).unbind(change, appendBoxField); $(#divBoxes input:last).bind(change, appendBoxField).focus(); } function appendBagField() { var len = $(#divBags input).length + 1; //alert(len); $(#divBags).append('input type=text name=_photo_bag_ID_' + len + ' /') $(this).unbind(change, appendBagField); $(#divBags input:last).bind(change, appendBagField).focus(); } Thanks, Terry
[jQuery] Re: li/img click and window.keydown
up On 16 juil, 08:10, Lideln lid...@gmail.com wrote: up ! (wow, this forum gets 10 new posts per hour) On 15 juil, 21:52, Lideln lid...@gmail.com wrote: Hi everybody ! I have a jqModal window, and I would like to close it using the ESC key. For that purpose, I assign my modal a keydown() event, and if keyCode == 27, I close the modal. It works fine, except when I click on another element in the modal first I have to press 2 times ESC : the first time removes the focus from the element, the second time goes through my listener and closes the modal. In my modal , I have an ul/li list, each li containing an img (for the purpose of an image gallery). When I click on an image (or li ?), I have to press twice ESC to close the modal. I tried to add a $(this).blur() in the li click() event, and also I tried to put that in the img click event, but without success... Does somebody know why it is doing that, and how to fix it, please ? Thanks a lot !
[jQuery] tablesorter not sorting numbers correctly
tablesorter isn't sorting numbers correctly. I have the latest jQuery (1.3.2) and tablesorter (2.0.3). from http://abitibi.sbgrid.org/: script type=text/javascript src=/js/jquery-latest.min.js/ script script type=text/javascript src=/js/ jquery.tablesorter.min.js/script I am turning on tablesorter on *all* tables using: $(document).ready(function() { $(table).tablesorter(); }); Then my tables have no other class or id attributes. I simply use thead/tbody and th elements. You can see an example here: http://abitibi.sbgrid.org/cgi/du.py/opt/osg-local Suggestions regarding how to correct this would be greatly appreciated. Ian
[jQuery] Jquery UI Tabs and Ajax
Hi together, I tried it in the group Jquery UI - but nobody answer there?! I'm really new to jQuery and UI. What I'm trying is to build a view in CakePHP with the jQuery UI Tabs. The first part, integration the informations from my Cake controller in Tab 1 to 4 is working. In Tab 5 and Tab 6 I want to show informations which are in relation to the dataset of Tab1 to Tab4. I.e. Im calling a Post-View. In Tab 5 I want to show the attachements (1 : n relation). So I do the following: div id=tabs ul lia href=#tab-1span?php echo __('Details'); ?/span/ a/li lia href=#tab-2span?php echo __('Fittings'); ?/ span/ a/li lia href=#tab-3span?php echo __('Conditions'); ?/ span/a/li lia href=#tab-4span?php echo __('Partner'); ?/span/ a/li lia href=/admin/attachements/getlist/?php echo $this-data ['Posts']['id]; ?span?php echo __('Object attachements'); ?/ span/a/li /ul I think I have to tell the object, that the fiftht tab is an ajax call. But I don't know how to mix them: script type=text/javascript $(function() { $(#tabs).tabs(); $('#tabs').tabs({ remote: true }); }); /script Have anybody an idea for me? Regards Thomas
[jQuery] Can't iterate through SPANs and execute Ajax GET
As soon as the page loads, I would like to iterate through several span tags on the page and update their innerHTML to be the response from the AJAX get call. The line I have commented out, alert(Data Loaded: + data);, works perfectly, but creates a bunch of alert boxes (which I don't want). And if I move the line this.innerHTML = data; out of the Ajax call, it works fine also. So I know all the syntax is correct. But when I put it together as outlined below, it just won't work. The Ajax is working, I also see the GET calls working fine in the Firebug console.It just won't update the innerHTML of the SPAN tags. Please, any help would be greatly appreciated! $(document).ready(function() { $(span).each(function (i) { $.get(myfile.php, { target: this.id, key: value }, function(data){ // alert(Data Loaded: + data); this.innerHTML = data; }); }); });
[jQuery] Recoving failure on request submission
Hi everyone, First, I have to say the jquery form is just perfect and fills very well a common issue for those who need to work with ajax. I would like to know, or even sugest a new feature if it is the case: how can we get, on client side and after an 'ajaxSubmit' call, the error code produced on server side? Is it possible to include such function on jquery form? Because we already have a 'success' callback functionality, how about a 'failure' one?
[jQuery] addclass() only works with the first of the matched divs
Hi, I'm having an annoying issue with addClass() I'm trying to find all divs with id name '#moldura_slides' and add the class '.horizontal' to each one of them. The problem is that only the first div matched gets the class. The others are just ignored and don't get it. $(document).ready(function() { $(#moldura_slides).addClass(horizontal); }); Looked for a solution everywhere and tried other ways of doing this. Nothing worked. Any ideas? This is the page: http://www.labbi.com.br/index5.html Thanks
[jQuery] Newbie question
Hello, I have just discovered jQuery and it looks cool. I used the jQuery UI builder at ui.jquery.com to build the UI and it looks and works great :) Unfortunately I do not know enough about javascript to answer my own question, so I am deferring to you :) I would like to have a tab with a dialog button on it, and when that dialog comes up there will be a form. This part I can do easily enough and have already implemented, however, what I need to do after that is where I am stuck :( I want the user to fill out the form, say there are fields like Customer Name Telephone Number and D.O.B. and once that form is filled out, and the user clicks OK, I want it to do the proper inserts, etc into my mysql database. This is probably a very easy question, but I have not found out anything useful so far through various google searches. I would like to do the bulk of my mysql stuff via perl/mason. Is there a tutorial anywhere for this or perhaps I should be using a different technique? I am trying to avoid PHP simply because I would prefer to not have to learn PHP while I am in the process of learning the things I need for jQuery, but I can if I need to. Any advice/help/examples would be greatly appreciated., Greg Evans
[jQuery] Help for a noob: AJAX, Autocompletes and JSON
Hi, Im new to ajax and serverside scripting (forgive me for the rediculous questions i will ask i'm only 15). I want to create a page where there is an auto-comples plugin that will pull the values from a JSON database(?) Once the user clicks on the value it will populate a container div with other values from the JSON database. So for example: I search for a name and when i click that name it will populate a div with, for example : an email adress, phone number etc. I really need to have a step by step process on what i need to do but here is the process i was thinking of User searches [ autocompletes pulls values from a json database ] -- User clicks on a value -- Information is pulled from the JSON database and populates a container div. I hope that makes sense :S. Thanks alot in advance... Phil
[jQuery] including JQuery JS changes font size in table cells
Greetings, I have a strange situation. I've just added an include of the JQuery JavaScript file and the font size of text in some table cells has increased. I've also noticed a text field displaying shorter (less height) but with the same font size, so all you see it the tops of the characters. The page doesn't have the cleanest CSS. The page is built dynamically, so it would be tricky to try to put together a simple test case. However, I'm surprised that including a JS file and not using anything from it is changing any styles on the page. Has anyone else seen anything like this or know why just including the JS would do this? I can work around the problem by adding explicit CSS rules to the td tags rather than relying on them inheriting the style, but I'd rather fix it at the source so I don't have to worry that I've missed fixing a style (like I might have missed the text field). Thanks. -Brian
[jQuery] jQuery, JSON and AJAX (help please)
Hi, Im new to ajax and serverside scripting (forgive me for the rediculous questions i will ask i'm only 15). I want to create a page where there is an auto-comples plugin that will pull the values from a JSON database(?) Once the user clicks on the value it will populate a container div with other values from the JSON database. So for example: I search for a name and when i click that name it will populate a div with, for example : an email adress, phone number etc. I really need to have a step by step process on what i need to do (i should be fine with the coding part) but here is the process i was thinking of User searches [ autocompletes pulls values from a json database ] -- User clicks on a value -- Information is pulled from the JSON database and populates a container div. I hope that makes sense :S. Thanks alot in advance... Phil
[jQuery] Re: addclass() only works with the first of the matched divs
pretty simple problem, all ID's have to be unique(w3c standards), change ID's to class will work fine Alexandre wrote: Hi, I'm having an annoying issue with addClass() I'm trying to find all divs with id name '#moldura_slides' and add the class '.horizontal' to each one of them. The problem is that only the first div matched gets the class. The others are just ignored and don't get it. $(document).ready(function() { $("#moldura_slides").addClass("horizontal"); }); Looked for a solution everywhere and tried other ways of doing this. Nothing worked. Any ideas? This is the page: http://www.labbi.com.br/index5.html Thanks
[jQuery] Re: jquery ui dialog get element from button
sure, just add $("#dialog").load("url") to click function you have Carlo Landmeter wrote: Thanks for your replies. If I look at your first option I wouldn't know how i could know the correct ID before i click the button but i have to initiate the dialog open after the normal dialog function. You second option seems the best way for me, after the dialog is created i can modify its content with your suggested code. Now I still want to find if i can also load a page with ajax (load) instead of a local div. Thx again, Carlo code: $(document).ready(function(){ $("#dialog").dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: "#000",opacity: 0.5}, resizable:false, buttons:{ "Delete": function() {}, "Cancel": function() {$(this).dialog("close");} } }); $(".button").click(function(event){ $("#dialog").dialog("open"); $("#ui-dialog-title-dialog").text($(this).attr("id")); }); });'; div id="dialog"this is a test/div On Thu, Jul 16, 2009 at 3:55 PM, Charliecharlie...@gmail.com wrote: dialog has a setter option for title, it isn't really a title attiribute. The dialog "title is actually a span with class ui-dialog-title-dialog http://jqueryui.com/demos/dialog/#option-title $('.selector').dialog('option', 'title', 'Dialog Title'); either pass the id into the option or you can use $(".button").click(function(event){ $('#dialog').dialog('open'); $('. ui-dialog-title-dialog ').text($(this).attr("id")); }); constructor must be separate as Mike pointed out Mean Mike wrote: Yes that is correct you need to separate the dialog from the open like this note: I set the autoOpen to false. [code] $(document).ready(function(){ $(".button").click(function(event){ $("#dialog").attr("title", event.target.id); $('#dialog').dialog('open'); }); $("#dialog").dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: "#000",opacity: 0.5}, resizable:false, buttons:{ "Delete": function() {}, "Cancel": function() {$(this).dialog("close");} } }); }); [/code] let me know how that works out for you Mean Mike On Jul 16, 8:31am, Carlo Landmeter clandme...@gmail.com wrote: Hi, I have probably a simple question which i cannot seem to find the answer to. I have a series of images which i want to use as buttons to trigger a dialog. Inside this dialog i need the ID of the image button (or any other element). But it seems after I load the dialog i cannot alter the content of it anymore. As an example I have tried to change the title of the #dialog so it will show the updated title when i click the button. The only way i am able to do this is when i put all of this inside the .click function and start with .attr function followed by the .dialog function. The problem is when i do this and close the dialog i cannot enable the dialog anymore. I guess this is why they have the .dialog("open"). Is there a way i can achieve what I'm trying to do here? Maybe there is a better way of doing this? Tia, Carlo code: $(document).ready(function(){ $(".button").click(function(event){ $("#dialog").attr("title", event.target.id); $("#dialog").dialog({ autoOpen:true, modal:true, overlay: {backgroundColor: "#000",opacity: 0.5}, resizable:false, buttons:{ "Delete": function() {}, "Cancel": function() {$(this).dialog("close");} } }); }); }); div id="dialog" title="i did not change"this is a test/div
[jQuery] Re: addclass() only works with the first of the matched divs
Id must to be unique. So, jQuery just find one element with the specified Id, try to make id uniques - Original Message - From: Alexandre alexandre...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, July 16, 2009 3:40 PM Subject: [jQuery] addclass() only works with the first of the matched divs Hi, I'm having an annoying issue with addClass() I'm trying to find all divs with id name '#moldura_slides' and add the class '.horizontal' to each one of them. The problem is that only the first div matched gets the class. The others are just ignored and don't get it. $(document).ready(function() { $(#moldura_slides).addClass(horizontal); }); Looked for a solution everywhere and tried other ways of doing this. Nothing worked. Any ideas? This is the page: http://www.labbi.com.br/index5.html Thanks
[jQuery] Re: Disabling Button in jQuery HTML Form Plugin
In addition to trying Cesar's suggestion, you should give us some more code details and context. You can do this sort of check on a number of events, including onclick and onsubmit, or whenever your div is updated. Ted On Thu, Jul 16, 2009 at 6:41 PM, Cesar Sanz the.email.tr...@gmail.comwrote: you can check the message in the onclick event... - Original Message - From: icuucme deron.tava...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Sent: Thursday, July 16, 2009 4:37 PM Subject: [jQuery] Re: Disabling Button in jQuery HTML Form Plugin still looking for help with this...thanks On Jul 8, 1:36 pm, icuucme deron.tava...@gmail.com wrote: I am currently using this pluginhttp:// www.malsup.com/jquery/form/#code-samples (HTML) to display a div with content, depending on what is entered. Is there a way to disable the submit button if the div contains a certain message?
[jQuery] Re: tablesorter not sorting numbers correctly
Last I checked *sym link* wasn't a number. ;-) aquaone On Thu, Jul 16, 2009 at 09:51, Ian Stokes-Rees ijsto...@alumni.uwaterloo.ca wrote: tablesorter isn't sorting numbers correctly. I have the latest jQuery (1.3.2) and tablesorter (2.0.3). from http://abitibi.sbgrid.org/: script type=text/javascript src=/js/jquery-latest.min.js/ script script type=text/javascript src=/js/ jquery.tablesorter.min.js/script I am turning on tablesorter on *all* tables using: $(document).ready(function() { $(table).tablesorter(); }); Then my tables have no other class or id attributes. I simply use thead/tbody and th elements. You can see an example here: http://abitibi.sbgrid.org/cgi/du.py/opt/osg-local Suggestions regarding how to correct this would be greatly appreciated. Ian
[jQuery] Re: show dynamic changes when a refresh occurs
The data is still there since the browser does a cache of the form info, but dynamically created elements do not get cached in the same way, unfortunately. I haven't tried this before, but one thing you can try is to have a hidden input in your form, and the purpose of this is to store the number of fields you have dynamically generated. Every time you add/ remove fields, you update this number. Then on page load, you populate the form with this many extra fields. However, since I haven't tried this before, I'm guessing that the new fields will not be pre- populated like the other static fields I don't think there really is any good workaround for that except to constantly save the form data to a cookie or to a database (via AJAX). Another is to use the onbeforeunload event handler which is triggered right before a page is left/re-loaded, and a prompt will be given, which can be canceled and the refresh will not occur. (Google Groups uses this when you type a message and try to leave/refresh the page.) Just do a Google search on this and you'll find out lots about it. On Jul 16, 12:46 pm, Terry tgshan...@excite.com wrote: Hi, I have a moderate level of experience with javascript, and a good oo background. So, when I tried jquery I'm really liking it. I have a requirement to add input fields dynamically to the form since I don't know ahead of time how many entries the user may request. I was able to implement this with jquery very quickly with a small amount of code. When the form is submitted it is sent to the server with all of the data correctly passed. However, if I do a refresh, the dynamic fields go away, but the static fields still have data in them so I assuming that the dynamic data is still there. How can I verify this? When I show source, it only shows the original code; same even before the form is submitted. Is there a way to stop a refresh? This application may have 10 added fields or 300 added fields, and if the user does a refresh for some reason he'll want to see every thing that has been input so far. my code: $(document).ready(function() { $(#divBoxes input:last).bind(change, appendBoxField); $(#divBags input:last).bind(change, appendBagField);}); function appendBoxField() { var len = $(#divBoxes input).length + 1; //alert(len); $(#divBoxes).append('input type=text name=_UPS_Shipping_Label_' + len + ' /') $(this).unbind(change, appendBoxField); $(#divBoxes input:last).bind(change, appendBoxField).focus();} function appendBagField() { var len = $(#divBags input).length + 1; //alert(len); $(#divBags).append('input type=text name=_photo_bag_ID_' + len + ' /') $(this).unbind(change, appendBagField); $(#divBags input:last).bind(change, appendBagField).focus(); } Thanks, Terry
[jQuery] Re: Recoving failure on request submission
I believe that jQuery Form extends jQuery's native $.ajax method, so you could use the options for $.ajax also. In $.ajax options, there's an 'error' callback for non-success responses. Additionally, there's a 'complete' callback which also passes a reference to the XMLHTTPRequest object (the core of what handles the AJAX call), in which you're able to look at HTTP Header Responses and such. On Jul 16, 4:55 am, Ícaro Dourado icar...@gmail.com wrote: Hi everyone, First, I have to say the jquery form is just perfect and fills very well a common issue for those who need to work with ajax. I would like to know, or even sugest a new feature if it is the case: how can we get, on client side and after an 'ajaxSubmit' call, the error code produced on server side? Is it possible to include such function on jquery form? Because we already have a 'success' callback functionality, how about a 'failure' one?