[jQuery] Form values getting unsynchronized after ajaxsubmit [validate]
Hi All, I have a very weird issue that I have been trying to resolve for over a week now with no success in sight. I use jsp to generate a page of regional information. The regions are displayed as clickable blocks. On clicking each block a pop-up form opens up with the corresponding region details like id, name and acronym. These can be edited and submitted as updates. There is also a last block that allows to create a new region which on clicking opens the same kind of form as the others, except all the fields are blank and required. I am using jquery validator plugin (bassistance) to ensure that the user does not leave any field blank and I also use the form plugin to do an ajaxsubmit, so that the id enterred is not a duplicate id. On submitting the new region form, a new region gets created and updates the page fine, but intermittently when I click on the other existing blocks the information shown in the pop-up is for a completely different region: for example when I click on a block labelled Washington, the popup that comes up shows New York, NY, 02. On clicking New York block, the same (correct) information is show. This does not happen always and I have noticed it happening only in firefox, I use firefox more often also. Also if I take out the ajaxsubmit and do a simple form submit, it seems to not occur, but I need the ajaxsubmit for the id validation.. Interestingly, when I click on the reset button on the individual form, the values in the fields correct themselves automagically for that form.. I also used firebug, and when I mouseover the field in the firebug console, the values in the fields are shown correct (in forebug), except the page displays the incorrect info. I think this safely eliminates my java code as the culprit... Again - when I reset the particular form, the values are good, but only for that form, so if I want to clean all such incorrect data, I will have to open each form pop-up on the page and click on the reset button - this would not work even as a workaround. Below is the code if it helps: *** JS*** $(function() { var bbap = function() { $('.cbnav').live('click',function(event) { var target = $(event.target); if(($(target).is(.main-title)) || ($(target).is(.cls))) { $('.details').hide(); if($(target).is(.main-title)) $(target).next('.details').show(450); } else if ($(target).is('input[type=reset]')){ $('.derrors').hide(); $('.errors').hide(); } }); } bbap(); }); var v = $(function() { $('.main-title').click(function(event) { var target = $(event.target); var parent = $(target).parent(); $(parent).validate({ rules: { regionid: required, regionname: required, regionacronym: required, regioncode: required }, submitHandler: function(form) { $(form).ajaxSubmit({ target: 'body', error: function (xhr) { $('.derror').text(Errors: Please fix + xhr.responseText).show(fast); } }); return false; } }); }); }); $('input[type=reset]').click(function() { $('.derrors').hideErrors() }); *** /JS*** *** HTML*** div class=cbdd form class=cbnav action=user/region.jsp method=post div class='main-title'Washington (WAS)/div div class=details div class=clsclose /div div class=form-class labelId/label input type=text name=regionid value=01 size=2 readonly=readonly/ /div div class=form-class labelAcronym/label input type=text name=regionacronym value=WAS size=3/ /div div class=form-class labelName/label input type=text name=regionname value=Washington size=20/ /div div class=form-class labelCode/label input type=text name =regioncode value=M00 size=2/ /div div class=btn input type=submit value=Submit/ input type=reset name=resetButton value=Reset / /div /div /form form class=cbnav action=user/region.jsp method=post div class='main-title'New York (NY)/div div class=details div class=clsclose /div div class=form-class labelId/label input type=text name=regionid value=01 size=2 readonly=readonly/ /div div class=form-class labelAcronym/label input type=text name=regionacronym value=NY size=3/ /div div class=form-class labelName/label
[jQuery] Re: switching jquery tabs in code behind(C#)
Hi karngu, Here is the one of my tab: Can you send me the javascript to select this tab.. div id=tabs ul lia href=#tabs-1 style=font- size: 12pxAll/a/li /ul div id=tabs-1 /div /div On Jul 24, 1:38 am, karnqu jake.al...@gmail.com wrote: like morningZ said your probably looking for this... ClientScript.RegisterStartupScript(typeof (page class name), startupTabScript, javascript to select correct tab, true); The pain is knowing what the last tab they selected was. But in your case if the button they clicked was on that tab then it sounds pretty straight forward. On Jul 23, 1:34 pm, MorningZ morni...@gmail.com wrote: onclick event would be: - in the aspx'scode? - on the client? if it is in thecode, then any running of that postbackcodeis going to cause a page reload, and consequent defaulting to the first tab by default if you want the new page reload to stay on the current tab, then you would emit some client script (using Page.ClientScript) object to call theTabs' event that will switch the tab On Jul 23, 9:49 am, noorul noorulameen...@gmail.com wrote: I have five div tags(jquerytabs) in my aspx page...Inside the second div(tab) i have a button. onclick of that buttton the second div(tab) should be switched..instead of that the first tab is coming.. How can i switch the tab incodebehind(Inside button onclick event)...
[jQuery] Re: Toggle Div Based on Value
This should work fine script type=text/javascript $(document).ready(function() { $(#directors input[type='checkbox']).click(function() { $('span.RelStatus').each(function() { var RelStatusValue = $(this).find(span).text(); if (RelStatusValue == 'Retired') { $(this).parents(div.IndividualDirectors).toggle(); } }) }); }); /script When you are trying to affect more then one element at once, you need to be dealing in classes rather then id's. I also noticed the script was targeting #rptDirectors_ctl00_chkIncludeRetired which doesn't exist on the page. evanbu...@gmail.com wrote: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta content=en-us http-equiv=Content-Language / meta content=text/html; charset=windows-1252 http-equiv=Content- Type / script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3/ jquery.min.js type=text/javascript/script script type=text/javascript $(document).ready(function() { $(#rptDirectors_ctl00_chkIncludeRetired).click(function() { $('.RelStatus').each(function() { var RelStatusValue = $(this).text(); if (RelStatusValue == 'Retired') { $(this).parents(div).toggle(); } }) }); }); /script titleCustomize Your PDF Request/title /head body form name=form1 method=post action=customize.PDF2.aspx id=form1 table style=width: 375px class=style1 id=table1 border=0 tr td colspan=2 align=left nowrap div id=directors input id=chkIncludeRetired type=checkbox checked=checked / iShow Retired/i br / div id=10110 class=IndividualDirectors img src=/images/vspacer.gif width=58 alt=spacer / input name=rptDirectors$ctl01$chkDirectorName type=checkbox id=rptDirectors_ctl01_chkDirectorName class=chkDirector checked=checked value=10110 / span id=rptDirectors_ctl01_Label1M. Bernard/span span id=rptDirectors_ctl01_Label2Aidinoff/span (span id=rptDirectors_ctl01_Label3Director/span) (span class=RelStatus id=RelStatusspan id=rptDirectors_ctl01_lblRelStatusRetired/span/span)br / /div div id=106659 class=IndividualDirectors img src=/images/vspacer.gif width=58 alt=spacer / input name=rptDirectors$ctl02$chkDirectorName type=checkbox id=rptDirectors_ctl02_chkDirectorName class=chkDirector checked=checked value=106659 / span id=rptDirectors_ctl02_Label1Steven J./span span id=rptDirectors_ctl02_Label2Bensinger/span (span id=rptDirectors_ctl02_Label3CFO/span) (span class=RelStatus id=RelStatusspan id=rptDirectors_ctl02_lblRelStatusRetired/ span/span)br / /div div id=11685 class=IndividualDirectors img src=/images/vspacer.gif width=58 alt=spacer / input name=rptDirectors$ctl03$chkDirectorName type=checkbox id=rptDirectors_ctl03_chkDirectorName class=chkDirector checked=checked value=11685 / span id=rptDirectors_ctl03_Label1Stephen F./span span id=rptDirectors_ctl03_Label2Bollenbach/span (span id=rptDirectors_ctl03_Label3Director/span) (span class=RelStatus id=RelStatusspan id=rptDirectors_ctl03_lblRelStatusRetired/span/span)br / /div /div /td /tr tr td colspan=2 align=centerbr /input type=submit name=btnContinue value=Continue id=btnContinue /br //td /tr /table /form /body /html
[jQuery] Re: Need to validate Multiple email IDs with Comma Seprated
With pleasure. My English is not so good,so I paste the code directly: //copied from http://www.webtoolkit.info/javascript-trim.html function trim(str, chars) { return ltrim(rtrim(str, chars), chars); } function ltrim(str, chars) { chars = chars || \\s; return str.replace(new RegExp(^[ + chars + ]+, g), ); } function rtrim(str, chars) { chars = chars || \\s; return str.replace(new RegExp([ + chars + ]+$, g), ); } //I modified the regex. function validateEmail(field) { //var regex=/\b[a-z0-9._%+...@[a-z0-9.-]+\.[a-z]{2,4}\b/i; var regex=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; return (regex.test(trim(field))) ? true : false; } function validateMultipleEmailsCommaSeparated(value) { var result = value.split(,); alert(result); for(var i = 0;i result.length;i++) if(!validateEmail(result[i])) return false; return true; } On Fri, Jul 24, 2009 at 1:14 PM, Mohd.Tareq tareq.m...@gmail.com wrote: Hi Kuo Yang, * * *Thanks for your reply.* *I am doing the same thing, but if i am entering any other charecter like ( _ | ) ( ] [ )* *instead of comma, so its considering as a string after that not able to validate it.* * * *I am writing this kind of functions to validate my multiple email value.* * * function validateEmail(field) { var regex=/\b[a-z0-9._%+...@[a-z0-9.-]+\.[a-z]{2,4}\b/i; return (regex.test(field)) ? true : false; } function validateMultipleEmailsCommaSeparated(value) { var result = value.split(,); for(var i = 0;i result.length;i++) if(!validateEmail(result[i])) return false; return true; } *By the ways I am hitting to fix this problem of my script.* *If you have any suggestions for the same then plz let me know ... :)* *Thanks * On Thu, Jul 23, 2009 at 7:24 PM, Kuo Yang daras...@gmail.com wrote: You can split the Emails with the comma, and then validate them one by one. On Thu, Jul 23, 2009 at 9:49 PM, Mohd.Tareq tareq.m...@gmail.com wrote: Hi Guys, Can any one tell me validation ' *Email Validation for multiple emails (comma separated)* ' for textarea. I am writing Regular expression but not able validating the given input with comma :( Please suggest something in JQuery Or Javascript Thanking you Regard Mohd.Tareque -- Regard Mohd.Tareque
[jQuery] Re: Parsing a complicated JSON file with JQUERY !
well wot I'm doing is an ajax call to retrieve my json data . then i want to parse it show all the records in the #postContent. but wot is harder here is the fact that in my jason file there are three objects at the same time returned by the query. Posts/Category/Comment The Categorystructure is : *Category -Post - comment -comment_content -mail U can also take a look to the picture 4 more explained structure of the JSON data and i want go through each table(object) show it's records ... I did this code, it's browser cross(it works perfectly with FF IE6.. $('#blogPage #blogPostsHolder .Post a').live('click',function(){ var currentPost=$(this).attr('post_id');//get the current(Clicked) post id //Load The Blog Post When A Post Link Is Clicked/**/ $.post('posts/postslistbycat/', {params: ''}, function(data){ $.each(data, function(i){ //here i want to show my json records after parsing the different tables $(#postContent).html('some records here'); }); }, 'json'); return false; }); I hope I did explain it well this time regards Abraham On Jul 22, 3:17 pm, Abraham Boray abrahambo...@gmail.com wrote: As U can see guys , I got that json structure , I want to parse it with jquery , I searched in the web but it's seems my json file is a bite complicated :S here is the picture more clear thatn the file down !http://www.zshare.net/image/63013802b34a7372/ Here is my plane JSON file [{Post:{id:1,category_id:1,title:CSS Mastering,date:2009-07-21 22:40:00,content:How 2 CSS Master in 5 Days :D ,This association creation and destruction is done using the CakePHP model bindModel() and unbindModel() methods. (There is also a very helpful behavior called \Containable\, please refer to manual section about Built-in behaviors for more information). Let's set up a few models so we can see how bindModel() and unbindModel() work. We'll start with two models: This association creation and destruction is done using the CakePHP model bindModel() and unbindModel() methods. (There is also a very helpful behavior called \Containable\, please refer to manual section about Built-in behaviors for more information). Let's set up a few models so we can see how bindModel() and unbindModel() work. We'll start with two models: This association creation and destruction is done using the CakePHP model bindModel() and unbindModel() methods. (There is also a very helpful behavior called \Containable\, please refer to manual section about Built-in behaviors for more information). Let's set up a few models so we can see how bindModel() and unbindModel() work. We'll start with two models: ,visible:1},Category:{id:1,name:CSS,Post: [{id:1,category_id:1,title:CSS Mastering,date:2009-07-21 22:40:00,content:How 2 CSS Master in 5 Days :D ,This association creation and destruction is done using the CakePHP model bindModel() and unbindModel() methods. (There is also a very helpful behavior called \Containable\, please refer to manual section about Built-in behaviors for more information). Let's set up a few models so we can see how bindModel() and unbindModel() work. We'll start with two models: This association creation and destruction is done using the CakePHP model bindModel() and unbindModel() methods. (There is also a very helpful behavior called \Containable\, please refer to manual section about Built-in behaviors for more information). Let's set up a few models so we can see how bindModel() and unbindModel() work. We'll start with two models: This association creation and destruction is done using the CakePHP model bindModel() and unbindModel() methods. (There is also a very helpful behavior called \Containable\, please refer to manual section about Built-in behaviors for more information). Let's set up a few models so we can see how bindModel() and unbindModel() work. We'll start with two models: ,visible:1,Category:{id:1,name:CSS},Comment: [{id:2,post_id:1,date:2009-07-22 14:10:00,content:Nice TUTO ,Keep it up Dude!,userName:Reda,a_url:http:\/\/ k...@hani.bikhir,e_mail:ma...@gmailika.hy,showMail:1}, {id:6,post_id:1,date:2009-07-22 14:38:00,content:Nice TUTO ,Keep it up Dude!,userName:reda,a_url:http:\/\/ url.com,e_mail:m...@mail.fr,showMail:1}]}, {id:2,category_id:1,title:Beginning CSS,date:2009-07-21 22:41:00,content:Courses 4 Dummies . Beginning CSS,visible:1,Category:{id:1,name:CSS},Comment: [{id:3,post_id:2,date:2009-07-22 14:16:00,content:Nice CSS tut ;),userName:Talal,a_url:http:\/\/ rwina.talal.com,e_mail:mail...@gtol.de,showMail:1}]}]},Comment: [{id:2,post_id:1,date:2009-07-22 14:10:00,content:Nice TUTO ,Keep it up Dude!,userName:Reda,a_url:http:\/\/ k...@hani.bikhir,e_mail:ma...@gmailika.hy,showMail:1,Post: {id:1,category_id:1,title:CSS Mastering,date:2009-07-21 22:40:00,content:How 2 CSS Master in 5 Days :D ,This association creation and destruction is done using the CakePHP
[jQuery] How to deterine number of words in a string?
Hi all, Any jquery plugin can check number of word in a string instead using of .length?... Many thanks. Conrad
[jQuery] Re: Make width of inner div equal outer
Excellent, works a treat, thanks Eric... 2009/7/23 Eric Garside gars...@gmail.com $('.secondLevel').css('width', $('#header').width()); On Jul 23, 1:16 pm, Paul Collins pauldcoll...@gmail.com wrote: Hi all, I've got a problem with IE6 and I need to basically find the width of the header DIV and make the secondLevel DIV match it. So, I guess I need to target IE6 specifically in the code. Here's what I have: div id=header ul id=topNavigation lia href=/Home/a/li li class=selected a href=/About Us/a div class=secondLevel ul lia href=/Overview/a/li /ul /div /li lia href=/Contact/a/li /ul /div I'm not sure how to start with the script. I can calculate the width of the header DIV, but not sure how to force the secondLevel one to match it. alert($(#header).width()); Any help would be fantastic. Cheers Paul
[jQuery] Re: How to deterine number of words in a string?
you don't need a plugin, this will do it var string = $(span.string).text(); var count = string.split( ); alert(count.length); Conrad Cheng wrote: Hi all, Any jquery plugin can check number of word in a string instead using of .length?... Many thanks. Conrad
[jQuery] help with an animation effect
Morning all, I'm looking for some help with an animation effect and your thoughts on how best to achieve it. At this stage we simply have a graphical representation, we can splice the images up any way we like, I'm really looking for your suggestions. The first stage is just the basic static object: http://s949.photobucket.com/albums/ad332/thinkblue_album/?action=viewcurrent=satic.png Then, we have a slight mouse-over effect on the small tab at the bottom which slightly reveals the content (width a nice slidey effect). On a mouse-out the tab would go back to it's static state. http://s949.photobucket.com/albums/ad332/thinkblue_album/?action=viewcurrent=mouse-over.png Thirdly, once the tab has been clicked it should pull out (nice slidey effect again), notice this isn't like the slideDown() effect, the bottom of the thing comes out first, as if it were a card being pulled out from behind another by hand. Also note that the text/icon on the tab has changed. http://s949.photobucket.com/albums/ad332/thinkblue_album/?action=viewcurrent=sliding.png Finally we have it's resting state once it's pulled out completely, a click would simply send it back up again the way it came. http://s949.photobucket.com/albums/ad332/thinkblue_album/?action=viewcurrent=out.png Now this with any luck would degrade so that if JS was disabled then the tab would default to being fully pulled out so the content was exposed for anyone viewing the site without JS enabled. I'd imagine we'll be using the animate() method but this isn't something I've worked with before, I'd appreciate any help you can offer on how I should be structuring my HTML and JS for this. Thanks guys I appreciate it. Robert
[jQuery] Re: How to deterine number of words in a string?
or if you really do want it as a plugin Plugin: (function($){ $.fn.stringCount = function() { var string = this.text(); var count = string.split( ); var result = count.length; return result } })(jQuery); Use: $(function(){ alert( $(span.string).stringCount() ); }); Liam Potter wrote: you don't need a plugin, this will do it var string = $(span.string).text(); var count = string.split( ); alert(count.length); Conrad Cheng wrote: Hi all, Any jquery plugin can check number of word in a string instead using of .length?... Many thanks. Conrad
[jQuery] Tablesorter problem when moving columns around
For an app I'm making I have a table with one always visible column, then you can view 5 more, any extra columns are hidden. The 5 are selectable so that you can choose which 5 you want to see. This all works great except that I need to move the columns so that the order of the columns is the same as what the use has selected. (see: http://www.bungert.co.uk/forum_pics/table1.jpg ) To do that I use the following function: this.moveColumn = function(selecIdNum, selector) { var cells = $('.' + selector).clone(true); // Copy the cells var numberOfRows= cells.length - 2; // - Cells from tfoot and thead var cellSelector= 'TextCell'; // Remove the cells $('.' + selector).remove(); if (selecIdNum 0) // If this is not the first selector { // Change the cellSelector cellSelector = selectors[selecIdNum - 1].lastActive + 'Cell'; } // Add the thead tfoot cells $('#contentTable thead th.' + cellSelector).after(cells[0]); $('#contentTable tfoot th.' + cellSelector).after(cells[1]); // Now the tbody cells for (row = 0; row numberOfRows; row ++) { // Get the TD that we need to paste after var td = $('#contentTable tbody tr.row' + row + ' td.' + cellSelector); // Insert the new cell $(td).after(cells[row + 2]); } //$(#contentTable).tablesorter(); } The move is fine, it shows the columns in the same order as the user has selected but the events are all gone when I copy the cells using: var cells = $('.' + selector) I now use: var cells = $('.' + selector).clone(true); and this copies my onmouseover/out events but the table sorting ones are no longer there. I tried re-applying tablesorter();, this sort of works. I can sort the new column but only once, then it does nothing... teh same is also true for all columns after calling tablesorter() again. Anyone know how I can clone the cells with all their tablesorting functions? Or re-apply the tablesorter() function so that the sorting works? - -- Stephen Bungert -- View this message in context: http://www.nabble.com/Tablesorter-problem-when-moving-columns-around-tp24642526s27240p24642526.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] find() not working in Firefox
Hello all, Below code works well for IE but not for firefox due to newlines present in the html source.Can anybody help me making this work in FF.It works well in IE6 html head script src=http://code.jquery.com/jquery-latest.js;/script script $(document).ready(function(){ $(body).find(p:contains('When the day is short find that which matters to you or stop believing')).replaceWith( 'spanchota/ span' ); }); /script /head body p When the day is spanshort/span find that which bmatters/b to you or stop believing /p /body /html Thanks in advance Sourabh
[jQuery] Re: Listnav initial display of no items?
Yes, the little treasure is your plug-in!! Um, I hit a deadend though. But it's not you, it's me! I don't quite understand where to put this stuff--am I to add it to to this? $(function(){ $('#alphalist').listnav({ includeAll: false, cookieName: 'xalpha_list' }); });
[jQuery] Re: Tablesorter problem when moving columns around SOLVED
Hello all, I solved this problem by making a new trigger which I call after moving the columns around: .bind(colOrderChanged,function() { $headers = buildHeaders(this); var sortList = config.sortList; updateHeaderSortCount(this,sortList); //set css for headers setHeadersCss(this,$headers,sortList,sortCSS); }) - -- Stephen Bungert -- View this message in context: http://www.nabble.com/Tablesorter-problem-when-moving-columns-around-tp24642526s27240p24642904.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: How to deterine number of words in a string?
Is it as simple to do a letter count? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Liam Potter Sent: Friday, July 24, 2009 6:53 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: How to deterine number of words in a string? or if you really do want it as a plugin Plugin: (function($){ $.fn.stringCount = function() { var string = this.text(); var count = string.split( ); var result = count.length; return result } })(jQuery); Use: $(function(){ alert( $(span.string).stringCount() ); }); Liam Potter wrote: you don't need a plugin, this will do it var string = $(span.string).text(); var count = string.split( ); alert(count.length); Conrad Cheng wrote: Hi all, Any jquery plugin can check number of word in a string instead using of .length?... Many thanks. Conrad
[jQuery] Re: find() not working in Firefox
I could see that being VERY slow $(p).each(function() { if ($(this).text()=='When the day..believing') { $(this).replaceWith('spanchota/span'); return false } }) would work, but I wouldn't recommend it. Anyway, why would you want to do this, and how would you manage to get the exact text that's going to be in the paragraph into the JavaScript ? If you have to edit the page to do that, why not just edit the paragraph itself ? L Sourabh wrote: Hello all, Below code works well for IE but not for firefox due to newlines present in the html source.Can anybody help me making this work in FF.It works well in IE6 html head script src=http://code.jquery.com/jquery-latest.js;/script script $(document).ready(function(){ $(body).find(p:contains('When the day is short find that which matters to you or stop believing')).replaceWith( 'spanchota/ span' ); }); /script /head body p When the day is spanshort/span find that which bmatters/b to you or stop believing /p /body /html Thanks in advance Sourabh No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.27/2258 - Release Date: 07/24/09 05:58:00
[jQuery] Re: How to deterine number of words in a string?
Assuming that people entering the string leave spaces after punctuation - commas, full-stops, exclamation marks, etc I've often had to tweak routines like this because people didn't. Depends on how accurate you need it, though; the code below will be thrown slightly by dashes, em-dashes (debatable as to whether they're counted as words) and people typing immediately after punctuation: e.g. correct : I went out last night. I had a great time, but I'm tired today! Can't wait til work ends - but that's 5 hours away [ only the dash will skew this ] incorrect, but regularly types : I went out last night.I had a great time,but I'm tired today!Can't wait til work ends-but that's 5 hours away [a few words discounted because of the lack of spaces after .,! Makes me wonder how the word-processors handle these, although I suspect they have approximately at the end ? If you need an approximation, though, [the other] Liam's solution will do nicely. Liam Potter wrote: or if you really do want it as a plugin Plugin: (function($){ $.fn.stringCount = function() { var string = this.text(); var count = string.split( ); var result = count.length; return result } })(jQuery); Use: $(function(){ alert( $(span.string).stringCount() ); }); Liam Potter wrote: you don't need a plugin, this will do it var string = $(span.string).text(); var count = string.split( ); alert(count.length); Conrad Cheng wrote: Hi all, Any jquery plugin can check number of word in a string instead using of .length?... Many thanks. Conrad No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.27/2258 - Release Date: 07/24/09 05:58:00
[jQuery] Re: jquery ui dialog get element from button
ok sorry for the delay, been kind of busy. Your problem is this ... the var somevar is defined in the click function and your are trying to use it in the constructor for the dialog therefore it is out of scope and not defined. This wouldn't work even if you made the var global because you must write the constructor before the click event occurs. So what you must do is define the buttons on click. like this [code] $(document).ready(function(){ //construct dialog $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false }); //create click event function $(.button).click(function(){ // on click do the following //change the title of the dialog $(#ui-dialog-title-dialog).text(Attention); // put a message in the dialog var message = You are about to do something: ; $(.ui-dialog-content).text(message + $(this).attr(id)); //set the dialog buttons $(#dialog).dialog('option', 'buttons', { Delete: function() {window.location = /home/+ $(this).attr (id) ;}, Cancel: function() {$(this).dialog(close);} }); $(#dialog).dialog(open); }); }); [/code] Make sense ? Mike On Jul 22, 9:29 am, Carlo Landmeter clandme...@gmail.com wrote: Sorry i forgot to add it. img style=cursor:pointer class=button id=REF09624002 src=images/delete.png / The button is placed before the dialog div. Carlo On Tue, Jul 21, 2009 at 2:43 PM, Mean Mikemcgra...@gmail.com wrote: Carlo buddy where is the button with the id that your looking for ? On Jul 21, 5:06 am, Carlo Landmeter clandme...@gmail.com wrote: I'm not able to send the whole html but i can show you the jquery stuff: I am using this in a drupal CMS with jQuery 1.2.6 and jQuery UI 1.6. Drupal includes the following css/js style type=text/css media=all@import /sites/default/modules/jquery_ui/jquery.ui/themes/default/ui.all.css;/style script type=text/javascript src=/misc/jquery.js/script script type=text/javascript src=/sites/default/modules/jquery_ui/jquery.ui/ui/minified/ui.core.min.js/script script type=text/javascript src=/sites/default/modules/jquery_ui/jquery.ui/ui/minified/ui.dialog.min.js/script script type=text/javascript src=/sites/default/modules/jquery_ui/jquery.ui/ui/minified/ui.draggable.min.js/script script type=text/javascript $(document).ready(function(){ $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {window.location = /home/ + somevar ;}, Cancel: function() {$(this).dialog(close);} } }); $(.button).click(function(){ $(#ui-dialog-title-dialog).text(Attention); var message = You are about to do something: ; $(.ui-dialog-content).text(message + $(this).attr(id)); var somevar = $(this).attr(id); $(#dialog).dialog(open); }); }); /script Then somewhere at the end of the page I have: div id=dialog/div Hope this helps. Carlo On Mon, Jul 20, 2009 at 9:11 PM, Mean Mikemcgra...@gmail.com wrote: can I see the html that goes with this code ? On Jul 18, 4:48 am, Carlo Landmeter clandme...@gmail.com wrote: Thanks for tip for my vars. I have tried the code you provided but this does not work. When i click my delete button it will complain that somevar is not set. So i guess it means the dialog function is run before the somevar variable is set. Anyway arround this? carlo On Fri, Jul 17, 2009 at 5:37 PM, Mean Mikemcgra...@gmail.com wrote: Carlo, jQuery /javascript is procedural so you just need to move things around like this [code] $(document).ready(function(){ $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {window.location = /home/ + $somevar ;}, Cancel: function() {$(this).dialog(close);} } }); $(.button).click(function(){ $(#ui-dialog-title-dialog).text(Attention); var message = You are about to do something: ; $(.ui-dialog-content).text($message + $(this).attr(id)); var somevar = $(this).attr(id);
[jQuery] Re: find() not working in Firefox
Thanks for your help Ok I have a scenario like this - I have an array with ['spanoriganal html/span' ]['spanhtml to be replaced /span'] This array will be available to me when the page is loaded. Now I have a HTML page (DOM or DOM container element) in which I need to search the ['spanoriganal html/span' ] and replace it with the ['spanhtml to be replaced /span']. This will apply to ANY HTML page . and HTML to find can be ANYTHING like bI /b am a igood/i span class=''fooboy / span Is there any better way to do this ? I also tried to go for traversing dom but I was not able to do that On Jul 24, 4:48 pm, Liam Byrne l...@onsight.ie wrote: I could see that being VERY slow $(p).each(function() { if ($(this).text()=='When the day..believing') { $(this).replaceWith('spanchota/span'); return false } }) would work, but I wouldn't recommend it. Anyway, why would you want to do this, and how would you manage to get the exact text that's going to be in the paragraph into the JavaScript ? If you have to edit the page to do that, why not just edit the paragraph itself ? L Sourabh wrote: Hello all, Below code works well for IE but not for firefox due to newlines present in the html source.Can anybody help me making this work in FF.It works well in IE6 html head script src=http://code.jquery.com/jquery-latest.js;/script script $(document).ready(function(){ $(body).find(p:contains('When the day is short find that which matters to you or stop believing')).replaceWith( 'spanchota/ span' ); }); /script /head body p When the day is spanshort/span find that which bmatters/b to you or stop believing /p /body /html Thanks in advance Sourabh No virus found in this incoming message. Checked by AVG -www.avg.com Version: 8.5.392 / Virus Database: 270.13.27/2258 - Release Date: 07/24/09 05:58:00
[jQuery] Re: How to deterine number of words in a string?
Yeah, if you need an all situation plugin there would be a lot more to add, but if you can guarantee each word will be separated by a space it will be fine, if not it will just be an approximate number. you would need to use regex to find all punctuation (except quotations), check if there is a letter afterwards and if so, to add a space/count as a new word. Liam Byrne wrote: Assuming that people entering the string leave spaces after punctuation - commas, full-stops, exclamation marks, etc I've often had to tweak routines like this because people didn't. Depends on how accurate you need it, though; the code below will be thrown slightly by dashes, em-dashes (debatable as to whether they're counted as words) and people typing immediately after punctuation: e.g. correct : I went out last night. I had a great time, but I'm tired today! Can't wait til work ends - but that's 5 hours away [ only the dash will skew this ] incorrect, but regularly types : I went out last night.I had a great time,but I'm tired today!Can't wait til work ends-but that's 5 hours away [a few words discounted because of the lack of spaces after .,! Makes me wonder how the word-processors handle these, although I suspect they have approximately at the end ? If you need an approximation, though, [the other] Liam's solution will do nicely. Liam Potter wrote: or if you really do want it as a plugin Plugin: (function($){ $.fn.stringCount = function() { var string = this.text(); var count = string.split( ); var result = count.length; return result } })(jQuery); Use: $(function(){ alert( $(span.string).stringCount() ); }); Liam Potter wrote: you don't need a plugin, this will do it var string = $(span.string).text(); var count = string.split( ); alert(count.length); Conrad Cheng wrote: Hi all, Any jquery plugin can check number of word in a string instead using of .length?... Many thanks. Conrad No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.27/2258 - Release Date: 07/24/09 05:58:00
[jQuery] Re: listnav letter question?
Ok... I think I got it. I tweaked the addClasses function to eval a list items attribute instead of the text value. I'm using the attrib LANG for now. I populate this server side with either the first character of the persons firstname or lastname depending on what order was selected on the page. So now I can generate a dynamic list of anything I like without needing to ensure the first char matches the navigation line selected character. I'm sure there is allot wrong with this approach, and I apologize in advance. My enviornment is strictly Intranet with mandated browser and version, so I can normally get away with much less test overhead than the will wild west... =) Cheers, Keith /// function addClasses() { var str, firstChar; var temp; $($list).children().each(function() { // ORIGINAL // $(this).text().replace(/\s+/g, ''); //.toLowerCase(); // strip all white space (including tabs and linebreaks that might have been in the HTML) // thanks to Liam Byrne, l...@onsight.ie // NEW str = $(this).attr(lang); if (str != '') { // ORIGINAL // firstChar = str.slice(0, 1).toLowerCase(); // NEW firstChar = str.toLowerCase(); if (!isNaN(firstChar)) firstChar = '_'; // use '_' if the first char is a number $(this).addClass('ln-' + firstChar); if (counts[firstChar] == undefined) counts[firstChar] = 0; counts[firstChar]++; allCount++; } }); } On Jul 20, 2009 11:33pm, keith keith.westb...@gmail.com wrote: Great solution to managing large lists... 3 thumbs up! =) After playing with it this evening, I found myself wondering what it would take to possibly target another attribute to determine its placement? For instance if I were to use an image instead of a link or some other type of content without any text, how would I tweak the plugin to eval this area instead of its text. Do you believe this would be a simple endeavor? Before I really dig in, I thought I would first ask yourselves and see if this was even possible without a huge rewrite. Thank you again for a really great tool... I look forward to using it in future projects. Respectfully, Keith
[jQuery] Selector help needed
with the markup like: prelt;ulgt; lt;ligt;lt;a href=quot;#quot;gt;Link 1lt;/agt;lt;/ligt; lt;ligt; lt;a href=quot;#quot;gt;Link 2lt;/agt; lt;ulgt; lt;ligt;lt;a href=quot;#quot; class=quot;activequot;gt;Link 2.1lt;/agt;lt;/ligt; lt;ligt;lt;a href=quot;#quot;gt;Link 2.2lt;/ agt;lt;/ligt; lt;/ulgt; lt;/ligt; lt;/ulgt; /pre i want to add a class active to , Link 2 (line 4), or links that have inner a.active links. how can i do it with jquery or even pure css?
[jQuery] Re: Selector help needed
sorry the code is ul lia href=#Link 1/a/li li a href=#Link 2/a ul lia href=# class=activeLink 2.1/a/li lia href=#Link 2.2/a/li /ul /li /ul On Jul 24, 9:20 pm, iceangel89 iceange...@gmail.com wrote: with the markup like: prelt;ulgt; lt;ligt;lt;a href=quot;#quot;gt;Link 1lt;/agt;lt;/ligt; lt;ligt; lt;a href=quot;#quot;gt;Link 2lt;/agt; lt;ulgt; lt;ligt;lt;a href=quot;#quot; class=quot;activequot;gt;Link 2.1lt;/agt;lt;/ligt; lt;ligt;lt;a href=quot;#quot;gt;Link 2.2lt;/ agt;lt;/ligt; lt;/ulgt; lt;/ligt; lt;/ulgt; /pre i want to add a class active to , Link 2 (line 4), or links that have inner a.active links. how can i do it with jquery or even pure css?
[jQuery] Re: Selector help needed
Links that have inner active links? $(a:has(ul li a.active)).css(active); i think that'll work if i understood you right cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Whether one believes in a religion or not, and whether one believes in rebirth or not, there isn't anyone who doesn't appreciate kindness and compassion..' From: iceangel89 iceange...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 07/24/2009 09:24 AM Subject:[jQuery] Re: Selector help needed sorry the code is ul lia href=#Link 1/a/li li a href=#Link 2/a ul lia href=# class=activeLink 2.1/a/li lia href=#Link 2.2/a/li /ul /li /ul On Jul 24, 9:20 pm, iceangel89 iceange...@gmail.com wrote: with the markup like: prelt;ulgt; lt;ligt;lt;a href=quot;#quot;gt;Link 1lt;/agt;lt;/ligt; lt;ligt; lt;a href=quot;#quot;gt;Link 2lt;/agt; lt;ulgt; lt;ligt;lt;a href=quot;#quot; class=quot;activequot;gt;Link 2.1lt;/agt;lt;/ligt; lt;ligt;lt;a href=quot;#quot;gt;Link 2.2lt;/ agt;lt;/ligt; lt;/ulgt; lt;/ligt; lt;/ulgt; /pre i want to add a class active to , Link 2 (line 4), or links that have inner a.active links. how can i do it with jquery or even pure css? inline: graycol.gifinline: ecblank.gif
[jQuery] Re: Loop with mouse enter / leave events: help needed !
hello EE, the problem here that you have positioned the background 24px from the top, so the button though looks till the image ends, but the actual div container which reads the mouseenter and mouseleave ends at the middle of the button image itself. as deltaf said, install the firebug add-on in firefox and then play around with you html/css and you can make out the reason. ~nitin On Jul 23, 9:40 pm, eelziere eelzi...@hotmail.com wrote: Hi All, I am very new to jquery. Here is a small page I made to get familiar with it: http://www.compu-zen.com/tests/jquery.popup_test.htm Could anybody explain me the following: when mouse cursor is located above the middle of the height of the button image, javascript is looping while sending mouseenter and mouseleave events. When the mouse cursor is below the middle of the height of the button image, it does not happen! Any idea? Thanks for your help. Cheers, EE.
[jQuery] How to load innovaeditor dynamically using jQuery AJAX
I have tried and contacted www.innovastudio.com about how to load their Editor dynamically by using jQuery Ajax.I have 3 files: Default.asp - ajax.js and a request page editor.asp What I have tried: By rendering ajax.js in default.asp I try to the load the editor in a div id=editor/ in default.asp I can't get it work - does anyone have any ideas? Best regards, Paul
[jQuery] sortable bug in ie7
hi guys. someone have a solution to the following problem? im using the sortable ui and when i sort some divs (bug is just in ie7 or below, in ie8, ff or somewhere else it works) the dragged div disappears. seems is is a sort of render problem cause when i perform a right click (contextmenu opens) the div is appearing again. but each other js function on the page activates the div again. maybe after performing a js function ie renders the page new... i dunno. someone can help me? im sorry for my bad english! :-( steve --~--~-~--~~~---~--~~ 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] Re: Insert SWF using JS
Hey shaolin, the better way doing this is using the swfobject script which is much easier to implement and has better integration with javascript/ajax interaction with flash. ~nitin On Jul 24, 12:38 am, shaf shaolinfin...@gmail.com wrote: Hi Guys I have some JS that flash cs4 generated when I published my swf. I am trying to do some AJAX and download the SWF and then insert it into the page's DIV tag. How can I do this. Code below: AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=10,0,0,0', 'width', '873', 'height', '247', 'src', 'banner', 'quality', 'high', 'pluginspage', 'http://www.adobe.com/go/getflashplayer', 'play', 'true', 'loop', 'false', 'scale', 'showall', 'wmode', 'transparent', 'devicefont', 'false', 'id', 'banner', 'name', 'banner', 'menu', 'false', 'allowFullScreen', 'false', 'allowScriptAccess','sameDomain', 'movie', 'banner' ); //end AC code
[jQuery] Form Elements . button with jQuery
Hi , I have problem with Form in HTML . I cannot access button like this HTML PART div id=newsletter class=facebox style=display: none; form id=myForm class=jqTransform input type=text name=email id=emaill value=wpisz email maxlength=50 / input type=button class=buttonNewsSub id=submit name=submit value=wyślij / /form script type=text/javascript $(function() { $(form#myForm-DISABLED).jqTransform(); }); /script /div I have no succces with accesing button from that Form , I use #myForm and other:button .class and no succes . SCRIPT JQUERY script type=text/javascript $(document).ready(function() { var emailT = function() { var email = $(#emaill).val() return (email); }; // alert( emailT); alert('Ready'); $('#myForm').serialize() function showValues() { // var str = $(form).serialize(); //$(#myForm).text(str); } $(#myForm input[type=button]).click(function () { alert('klik'); showValues(); var email = emailT(); var dataString = 'addr='+ $(#emaill).val() + 'action=sub'; $.ajax({ type: get, url: maillist/index.php, data: dataString, success: function(data) { $('#faceboxDiv').empty(); var response = $(data).find('#faceboxDiv').html(); $('#faceboxDiv').hide().html('brbrstrong' + data + '/strongbrbr').fadeIn(); $(.close).click(function(){location.reload()} ); }}); }); } ); /script . Please help , how can I assign .click() to submit properly ? -- View this message in context: http://www.nabble.com/Form-Elements-.-button---with-jQuery-tp24644258s27240p24644258.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] (validate) IE6 odd focus behavior
I'm using the validate plugin on a form and in IE when I click right above the second required field the cursor focus is between the label and the form field. It looks like you are typing outside of the form, in between the / label and input. I validated the html of the form. It looks like it only happens on required fields which makes me think it's something with the validation success HTML in the plugin. Any suggestions? --~--~-~--~~~---~--~~ 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] Re: (validate) IE6 odd focus behavior
I've seen that, but had no idea what caused it. Your help with localizing the issue is very welcome. Jörn On Fri, Jul 24, 2009 at 3:44 PM, jckosjohncar...@gmail.com wrote: I'm using the validate plugin on a form and in IE when I click right above the second required field the cursor focus is between the label and the form field. It looks like you are typing outside of the form, in between the / label and input. I validated the html of the form. It looks like it only happens on required fields which makes me think it's something with the validation success HTML in the plugin. Any suggestions?
[jQuery] Re: clone() + Sortable and Draggable
its because you need to make it live so that when new items with the same class show up they become sortable. I've never used live with sortable so you might need to investigate further but I think this will work $(.liste_champs)live(sortable, function(){ revert: true, connectWith: $(.liste_champs), start: function(){ $(.liste_champs).addClass('ui-state-highlight'); }, stop: function(){ $(.liste_champs).removeClass('ui-state-highlight'); }, receive: function(){ $(#champs).append($(#champs_caches).children().clone (true)); } }); btw sorry for the delay On Jul 17, 4:35 pm, Jérôme GRAS jeromeg...@gmail.com wrote: Ok, I fixed the first id bug. The new version is online. Unfortunately, the main problem is still present. I tried a lot of things unsuccessfully... Please take a look :-) On Fri, Jul 17, 2009 at 15:07, Mean Mike mcgra...@gmail.com wrote: I found a least one major problem here $(#champs).append($(#champs_caches).clone(true).removeClass(ui- helper-hidden)); your cloning div with id #champs_caches thereby creating another div with the same id there may be more problems than that but get that fixed then lets go from there Mean Mike On Jul 17, 2:58 am, rejome jeromeg...@gmail.com wrote: Hello everyone ! I am facing a strange problem here : http://rejome.homeip.net:8080/prototype.html When I clone a list that is part of a Sortable, the Draggable objects are not bound to the cloned list, only the original one. Do you have a solution or a hint for me please ? Thanks in advance. Réjôme.
[jQuery] Digg JSONP API seems to have problem with $.getJSON implementation
Hi Everybody, I was trying to access Digg's search API with $.getJSON as well as with Twitter and Identica. Although, the twitter and identica search api are working fine, I have found trouble when it come to accessing Digg API. The case in point URL : http://services.digg.com/search/stories?query=geekoappkey=http%3A%2F%2Filovejquery.orgtype=javascriptcount=15callback=someFunction This URL, when provided in location bar of the browser gives back the result successfully. Now change the someFunction with ? to access ( for JSONP approach in $.getJSON ) the JSON data provided by this Digg API URL in a jQuery code and sadly it will give return error message saying Unrecognized argument. The script element generated is following. --- script src=http://services.digg.com/search/stories? query=geekoappkey=http%3A%2F %2Filovejquery.orgtype=javascriptcount=15callback=jsonp1248445717722_=1248445717771 -- This is due to the additional argument provided when replacing ? in the implementation of getJSON method . That additional argument has _ as name and some timestamp as value. I commented out line 3453 in the latest jquery-1.3.2.js file meant to be used while in development and things are working fine. Note that, I don't see any change of behaviour for the Twitter as well as Identica call. It looks they are ignoring the additional arguments while the Digg is not. I don't know why the additional parameter is added while replacing ? in getJSON request, but it is definately not acceptable to one of the popular webservice. Hope this brings any compatibility issue to the notice. Thanks Best Regards Samyak
[jQuery] Using a load function with a post
I am unsure as to how to make this work. var params = $('form#createAdjForm').serialize(); var url = ?= $this-url(array('controller'='create-adjustment', 'action'='index'))?; $('#form').load(url,params); I want my data POSTed but it is still sent as a get. What am I doing wrong?
[jQuery] jQuery validation on 3 select box
Hi there, I had a form where I need user to input the their birthdate: select id=sel_dd name=sel_dd option value=/option option value=11/option ... /select select id=sel_mm name=sel_mm option value=/option option value=1Jan/option ... /select select id=sel_yy name=sel_yy option value=/option option value=19801980/option ... /select How do I write custom validation rule to check if user had selected appropriate input? And which control should I assign the rule on? Thanks.
[jQuery] Re: jquery ui dialog get element from button
Hi Mike, Yes its working now. Now that i understand that part and looked at the api again i saw: Get or set the buttons option, after init. Glad I get that fixed. Thanks for your help! I think if i play more with jquery things get easier for me to understand. Carlo On Fri, Jul 24, 2009 at 2:53 PM, Mean Mikemcgra...@gmail.com wrote: ok sorry for the delay, been kind of busy. Your problem is this ... the var somevar is defined in the click function and your are trying to use it in the constructor for the dialog therefore it is out of scope and not defined. This wouldn't work even if you made the var global because you must write the constructor before the click event occurs. So what you must do is define the buttons on click. like this [code] $(document).ready(function(){ //construct dialog $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false }); //create click event function $(.button).click(function(){ // on click do the following //change the title of the dialog $(#ui-dialog-title-dialog).text(Attention); // put a message in the dialog var message = You are about to do something: ; $(.ui-dialog-content).text(message + $(this).attr(id)); //set the dialog buttons $(#dialog).dialog('option', 'buttons', { Delete: function() {window.location = /home/+ $(this).attr (id) ;}, Cancel: function() {$(this).dialog(close);} }); $(#dialog).dialog(open); }); }); [/code] Make sense ? Mike On Jul 22, 9:29 am, Carlo Landmeter clandme...@gmail.com wrote: Sorry i forgot to add it. img style=cursor:pointer class=button id=REF09624002 src=images/delete.png / The button is placed before the dialog div. Carlo On Tue, Jul 21, 2009 at 2:43 PM, Mean Mikemcgra...@gmail.com wrote: Carlo buddy where is the button with the id that your looking for ? On Jul 21, 5:06 am, Carlo Landmeter clandme...@gmail.com wrote: I'm not able to send the whole html but i can show you the jquery stuff: I am using this in a drupal CMS with jQuery 1.2.6 and jQuery UI 1.6. Drupal includes the following css/js style type=text/css media=all@import /sites/default/modules/jquery_ui/jquery.ui/themes/default/ui.all.css;/style script type=text/javascript src=/misc/jquery.js/script script type=text/javascript src=/sites/default/modules/jquery_ui/jquery.ui/ui/minified/ui.core.min.js/script script type=text/javascript src=/sites/default/modules/jquery_ui/jquery.ui/ui/minified/ui.dialog.min.js/script script type=text/javascript src=/sites/default/modules/jquery_ui/jquery.ui/ui/minified/ui.draggable.min.js/script script type=text/javascript $(document).ready(function(){ $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {window.location = /home/ + somevar ;}, Cancel: function() {$(this).dialog(close);} } }); $(.button).click(function(){ $(#ui-dialog-title-dialog).text(Attention); var message = You are about to do something: ; $(.ui-dialog-content).text(message + $(this).attr(id)); var somevar = $(this).attr(id); $(#dialog).dialog(open); }); }); /script Then somewhere at the end of the page I have: div id=dialog/div Hope this helps. Carlo On Mon, Jul 20, 2009 at 9:11 PM, Mean Mikemcgra...@gmail.com wrote: can I see the html that goes with this code ? On Jul 18, 4:48 am, Carlo Landmeter clandme...@gmail.com wrote: Thanks for tip for my vars. I have tried the code you provided but this does not work. When i click my delete button it will complain that somevar is not set. So i guess it means the dialog function is run before the somevar variable is set. Anyway arround this? carlo On Fri, Jul 17, 2009 at 5:37 PM, Mean Mikemcgra...@gmail.com wrote: Carlo, jQuery /javascript is procedural so you just need to move things around like this [code] $(document).ready(function(){ $(#dialog).dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: #000,opacity: 0.5}, resizable:false, buttons:{ Delete: function() {window.location = /home/ + $somevar ;}, Cancel: function()
[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]
Attached an html - that shows my situation... In the page - clicking on any region opens the pop-up form, and once in a while after you submit the pop-ups are mixed up, you see Newyork details for the Washington tab etc. But as soon as I click on the reset button, it rectifies itself... Can somebody please help a bit? I am not able to understand / explain why this happens - I do not have a lot of javascript / jquery code, just the 2 functions... Should I call reset for all forms after I submit? If so can someone please show / hint at how that can be achieved? Thanks, Anoop On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V anoopkum...@gmail.comwrote: Hi All, I have a very weird issue that I have been trying to resolve for over a week now with no success in sight. I use jsp to generate a page of regional information. The regions are displayed as clickable blocks. On clicking each block a pop-up form opens up with the corresponding region details like id, name and acronym. These can be edited and submitted as updates. There is also a last block that allows to create a new region which on clicking opens the same kind of form as the others, except all the fields are blank and required. I am using jquery validator plugin (bassistance) to ensure that the user does not leave any field blank and I also use the form plugin to do an ajaxsubmit, so that the id enterred is not a duplicate id. On submitting the new region form, a new region gets created and updates the page fine, but intermittently when I click on the other existing blocks the information shown in the pop-up is for a completely different region: for example when I click on a block labelled Washington, the popup that comes up shows New York, NY, 02. On clicking New York block, the same (correct) information is show. This does not happen always and I have noticed it happening only in firefox, I use firefox more often also. Also if I take out the ajaxsubmit and do a simple form submit, it seems to not occur, but I need the ajaxsubmit for the id validation.. Interestingly, when I click on the reset button on the individual form, the values in the fields correct themselves automagically for that form.. I also used firebug, and when I mouseover the field in the firebug console, the values in the fields are shown correct (in forebug), except the page displays the incorrect info. I think this safely eliminates my java code as the culprit... Again - when I reset the particular form, the values are good, but only for that form, so if I want to clean all such incorrect data, I will have to open each form pop-up on the page and click on the reset button - this would not work even as a workaround. Below is the code if it helps: *** JS*** $(function() { var bbap = function() { $('.cbnav').live('click',function(event) { var target = $(event.target); if(($(target).is(.main-title)) || ($(target).is(.cls))) { $('.details').hide(); if($(target).is(.main-title)) $(target).next('.details').show(450); } else if ($(target).is('input[type=reset]')){ $('.derrors').hide(); $('.errors').hide(); } }); } bbap(); }); var v = $(function() { $('.main-title').click(function(event) { var target = $(event.target); var parent = $(target).parent(); $(parent).validate({ rules: { regionid: required, regionname: required, regionacronym: required, regioncode: required }, submitHandler: function(form) { $(form).ajaxSubmit({ target: 'body', error: function (xhr) { $('.derror').text(Errors: Please fix + xhr.responseText).show(fast); } }); return false; } }); }); }); $('input[type=reset]').click(function() { $('.derrors').hideErrors() }); *** /JS*** *** HTML*** div class=cbdd form class=cbnav action=user/region.jsp method=post div class='main-title'Washington (WAS)/div div class=details div class=clsclose /div div class=form-class labelId/label input type=text name=regionid value=01 size=2 readonly=readonly/ /div div class=form-class labelAcronym/label input type=text name=regionacronym value=WAS size=3/ /div div class=form-class labelName/label input type=text name=regionname value=Washington size=20/ /div div class=form-class labelCode/label input type=text name =regioncode value=M00 size=2/
[jQuery] Iframe Scroll
I tried to open a iframe with a definite position. Let’s say I have an iframe like: iframe id=frame src=http://google.com; width=350 height=350/iframe And I’d like to scroll at the position X,Y of google page. I tried scrollTop, scrollLeft and even the plugin scrollTo to no avail. Can I make $(‘#frame’).scrollTo(300); or $(‘#frame’).scrollTop(200).scrollLeft(300); Any help would be appreciated. -- View this message in context: http://www.nabble.com/Iframe--Scroll-tp24646526s27240p24646526.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Using Queue
Hi Guys I have 4 scripts I want to load and insert into the html. So the script should download and insert the first and then the second and so on. How can I do this in such a order ? From my research it looks like a queue is the best option for this. Is this true ? If yes, how do I go about to doing it ?
[jQuery] Re: listnav letter question?
Hi Keith, Glad you like the plugin. I missed your original post, but just spotted this one. Your change looks good, that's where I would have done it, too. I'm having a little trouble picturing your use case, though. Do you have an example anywhere or could you explain it a little bit more? I might considering adding an option for this kind of thing to the plugin. Thanks, Jack keith.westb...@gmail.com wrote: Ok... I think I got it. I tweaked the addClasses function to eval a list items attribute instead of the text value. I'm using the attrib LANG for now. I populate this server side with either the first character of the persons firstname or lastname depending on what order was selected on the page. So now I can generate a dynamic list of anything I like without needing to ensure the first char matches the navigation line selected character. I'm sure there is allot wrong with this approach, and I apologize in advance. My enviornment is strictly Intranet with mandated browser and version, so I can normally get away with much less test overhead than the will wild west... =) Cheers, Keith /// function addClasses() { var str, firstChar; var temp; $($list).children().each(function() { // ORIGINAL // $(this).text().replace(/\s+/g, ''); //.toLowerCase(); // strip all white space (including tabs and linebreaks that might have been in the HTML) // thanks to Liam Byrne, l...@onsight.ie // NEW str = $(this).attr(lang); if (str != '') { // ORIGINAL // firstChar = str.slice(0, 1).toLowerCase(); // NEW firstChar = str.toLowerCase(); if (!isNaN(firstChar)) firstChar = '_'; // use '_' if the first char is a number $(this).addClass('ln-' + firstChar); if (counts[firstChar] == undefined) counts[firstChar] = 0; counts[firstChar]++; allCount++; } }); } On Jul 20, 2009 11:33pm, keith keith.westb...@gmail.com wrote: Great solution to managing large lists... 3 thumbs up! =) After playing with it this evening, I found myself wondering what it would take to possibly target another attribute to determine its placement? For instance if I were to use an image instead of a link or some other type of content without any text, how would I tweak the plugin to eval this area instead of its text. Do you believe this would be a simple endeavor? Before I really dig in, I thought I would first ask yourselves and see if this was even possible without a huge rewrite. Thank you again for a really great tool... I look forward to using it in future projects. Respectfully, Keith
[jQuery] Re: Listnav initial display of no items?
Like this: style type=text/css #alphalist { display:none; } /style $(function(){ var clicks = 0; $('#alphalist').listnav({ includeAll: false, cookieName: 'xalpha_list', onClick: function(){ clicks++; if(clicks == 2){ $('#alphalist').show(); } } }); }); You can also take a look at demo 5 here to see onClick being used: http://www.ihwy.com/Labs/Demos/Current/jquery-listnav-plugin.aspx - Jack rubycat wrote: Yes, the little treasure is your plug-in!! Um, I hit a deadend though. But it's not you, it's me! I don't quite understand where to put this stuff--am I to add it to to this? $(function(){ $('#alphalist').listnav({ includeAll: false, cookieName: 'xalpha_list' }); });
[jQuery] Test - please ignore
Test - please ignore
[jQuery] Re: Test - please ignore
no, I will acknowledge! anoop wrote: Test - please ignore
[jQuery] Re: clone() + Sortable and Draggable
No problem for the delay, thank you for your response. I may be away for a while but I'll try to test and investigate as soon as possible. I will keep you updated. On Fri, Jul 24, 2009 at 16:16, Mean Mike mcgra...@gmail.com wrote: its because you need to make it live so that when new items with the same class show up they become sortable. I've never used live with sortable so you might need to investigate further but I think this will work $(.liste_champs)live(sortable, function(){ revert: true, connectWith: $(.liste_champs), start: function(){ $(.liste_champs).addClass('ui-state-highlight'); }, stop: function(){ $(.liste_champs).removeClass('ui-state-highlight'); }, receive: function(){ $(#champs).append($(#champs_caches).children().clone (true)); } }); btw sorry for the delay On Jul 17, 4:35 pm, Jérôme GRAS jeromeg...@gmail.com wrote: Ok, I fixed the first id bug. The new version is online. Unfortunately, the main problem is still present. I tried a lot of things unsuccessfully... Please take a look :-) On Fri, Jul 17, 2009 at 15:07, Mean Mike mcgra...@gmail.com wrote: I found a least one major problem here $(#champs).append($(#champs_caches).clone(true).removeClass(ui- helper-hidden)); your cloning div with id #champs_caches thereby creating another div with the same id there may be more problems than that but get that fixed then lets go from there Mean Mike On Jul 17, 2:58 am, rejome jeromeg...@gmail.com wrote: Hello everyone ! I am facing a strange problem here : http://rejome.homeip.net:8080/prototype.html When I clone a list that is part of a Sortable, the Draggable objects are not bound to the cloned list, only the original one. Do you have a solution or a hint for me please ? Thanks in advance. Réjôme.
[jQuery] can't get textarea field value using jquery rte plugin
Hi. I'm using this plugin: http://code.google.com/p/lwrte/ for a lightweight text editor. I want to be able to submit without a page reload and I can't seem to figure out how to override whatever code the author created to disable the value of the text area field unless the form is formally submitted using the submit button. Additionally I don't seem to be able to attach any events to the submit button. I'm not sure you will be able to help me but thought it's worth a shot. Here's the form: form method=post action=../postingfiles/tasks-main.php input name=id value= id=id type=hidden/ input type=text value=Untitled id=title name=title / a href=# id=saveSave/a textarea name=notes id=notes class=rte1 /textarea input type=submit value=click id=submit / /form Here's my code which returns id=title=untitled. $(document).ready(function() { $('#save').click(function($e) { $e.preventDefault(); var str = $(form).serialize(); alert(str); }); }); If you have any idea how someone would disable the textarea unless formally submitted maybe I can go searching for that type of thing in the js file. Or if you know of a better text editor I should check out that would be great too. I liked this one because it seemed fairly simple and not too ugly.
[jQuery] Re: Test - please ignore
Thanks - but if you really should, then please acknowledge my actual posts: http://groups.google.com/group/jquery-en/browse_thread/thread/130b4df144c2e0b9 I would much appreciate any help you could provide.. :-) -Anoop On Fri, Jul 24, 2009 at 12:26 PM, Liam Potter radioactiv...@gmail.comwrote: no, I will acknowledge! anoop wrote: Test - please ignore
[jQuery] Jquery Column Manager
hi, I am using column manager plugin, Did somebody use this plugin ? http://p.sohei.org/jquery-plugins/columnmanager/ I am having a problem when work with nested tables. I can post a example where I have the problem, if somebody can help me. greetings
[jQuery] Re: Listnav initial display of no items?
Thanks for the response and explaining it to me. Alas, I'm not having any luck. Using your exact example (both CSS and JS), the items associated with the first navigation item are still being displayed (the 0-9 option) on initial page load. I even disabled cookies while testing. :-(
[jQuery] Re: can't get textarea field value using jquery rte plugin
Nevermind. I'm stupid.
[jQuery] Re: GPL version of jQuery
Brilliant! Thank you very much for the information and also big thanks for such a good library ) On 24 июл, 03:54, Michael Geary m...@mg.to wrote: You don't need to worry about that at all. jQuery is also licensed under the MIT license, a much more liberal license than GPL. Simply use jQuery under the MIT license, not the GPL. That makes it fully compatible with any version of GPL you want to use for the rest of your code. More info here: http://en.wikipedia.org/wiki/MIT_License You don't have to do anything special to make this happen; just use the code and have fun! -Mike From: Alexey Chernov Hello, I develop open source CMS under GPLv3 and would like to use jQuery in it. Could you please tell me what is the version of GPL of jQuery? I tried to find it onhttp://jquery.combut it's still a little bit unclear. This is important for me, because GPLv2-only and GPLv3 are incompartible. Thank you in advance, Alexey
[jQuery] Draggables and offset
I've built an expanding HUD control for a map in a project. I've got it expanding, and, using some code from this group I have it avoiding the edges of the viewport on first resize. The problem is that it doesn't seem like an object updates its position when you make it draggable with the jQuery UI draggable plugin. The net effect is that this element constantly resizes outside the viewport, so that only an edge is showing and it has to be dragged back into the center of the page. What I'm looking for is a bulletproof solution for a window that is resizable on click and is aware of its -x and -y position even after being moved with jQuery UI Draggable. Current code follows... Thanks! /// // Collapse HUD /// // Triggers the #data floater to slide down // if a tab is clicked and it's closed hud = $('.hud-data'); hudPosition_init = hud.position(); hudWidth_init = hud.width(); var viewport = $(document).width(); var hudOffset = hud.offset(); hudChild = $('.jScrollPaneContainer'); $('.event-controls').click(function() { var eventBar = $('form.events'); $(eventBar).slideToggle({height:40px}, 90); }); $('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}); var viewport = $(document).width(); var hudOffset = hud.offset(); $(#map-filter-popdown-shadow).hide(); }); $('li.hud-center-tab').click(function() { // Perform the same check for this tab $(#data).slideDown(20); if (viewport - hudOffset.left 10) { hud.animate({width : hudWidth_init+359, margin-left :-350}, 90); hudChild.animate({width: hudWidth_init+360}, 20); } else { hud.animate({width : hudWidth_init+360}, 90); hudChild.animate({width: hudWidth_init+360}, 20); } //hud.animate({width : hudWidth_init+360}, 90); //hudChild.css({width: hudWidth_init+360}); $(#map-filter-popdown-shadow).hide(); }); $('#test-button').click(function(){ alert(hudPosition_init.left); }); $('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); }); /// // ///
[jQuery] Re: treeview, can only let +- expand tree?
Renewind this post. I have the asame problem. If any knows the solution, please post, or guide to proper answer. Thanks.
[jQuery] Which editor is best for inplace HTML
I'm hoping someone can help me narrow down the field according to these priorities... Stability Well-formed XHTML Inplace editing Good AJAX integration For internal / admin / CMS usage so size doesn't matter Only need the basics: bold ital indents lists No need for tables but dropdowns with relevent CSS selectors would be nice. thnkx --steve
[jQuery] Re: Using a load function with a post
According to the documentation for $.load: http://docs.jquery.com/Ajax/load if you pass in any extra parameters in the form of an Object/Map (key/ value pairs) then a POST will occur. Extra parameters passed as a string will still use a GET request. Using serialize() will pass the data value in as a String. You want to pass in an Object (JSON) instead by using serializeArray(): http://docs.jquery.com/Ajax/serializeArray On Jul 24, 4:32 am, Anthony Smith mrsmi...@hotmail.com wrote: I am unsure as to how to make this work. var params = $('form#createAdjForm').serialize(); var url = ?= $this-url(array('controller'='create-adjustment', 'action'='index'))?; $('#form').load(url,params); I want my data POSTed but it is still sent as a get. What am I doing wrong?
[jQuery] How can I keep the overlay in jQuery UI dialog longer than the modal window?
If the body of the page on which the modal window overlays is shorter than the dialog window, itself, then the overlay is cutoff. I want the overlay behind the modal window to extend beyond the window even if the body of the document is shorter than the modal dialog. Make sense? Rick -- Ninety percent of the politicians give the other ten percent a bad reputation. - Henry Kissinger
[jQuery] Re: Which editor is best for inplace HTML
Steve Hueners wrote: I'm hoping someone can help me narrow down the field according to these priorities... Stability Well-formed XHTML Inplace editing Good AJAX integration For internal / admin / CMS usage so size doesn't matter Only need the basics: bold ital indents lists No need for tables but dropdowns with relevent CSS selectors would be nice. thnkx --steve Got this list a few days ago: http://www.webdesignbooth.com/15-really-useful-web-based-html-editors/ Since I use malsup's form plugins, fsck and tinymce can work well with it. Fsck need http://www.webdesignbooth.com/15-really-useful-web-based-html-editors/ Using TinyMCE, you need to call save method before submit using form plugins. Hope this help. -- Donny Kurnia http://blog.abifathir.com http://hantulab.blogspot.com http://www.plurk.com/user/donnykurnia
[jQuery] Sortables - accessing elements in each container
I have some sortable div containers numbered 1 to 5. I would like to keep the input boxes in order (1 to 5) even while dragging and resorting. I've made code to plus/subtract upon a rearrange and that works if used properly. If you drag violently though, you can get the order out of whack. Maybe if I loop through all containers I could ensure the order is correct, but I don't see how I could access the first container, then the second container, etc. any ideas are appreciated. I'm very new to programming, maybe there's a simple way. thx, Eric is Sac
[jQuery] Re: How can I keep the overlay in jQuery UI dialog longer than the modal window?
Anyone have any idea about this? I thought about perhaps determining the height of the modal window and then comparing it to the body height and using whichever is greater as the overlay height.is that possible with js? From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Friday, July 24, 2009 5:00 PM To: jquery-en@googlegroups.com Subject: [jQuery] How can I keep the overlay in jQuery UI dialog longer than the modal window? If the body of the page on which the modal window overlays is shorter than the dialog window, itself, then the overlay is cutoff. I want the overlay behind the modal window to extend beyond the window even if the body of the document is shorter than the modal dialog. Make sense? Rick -- Ninety percent of the politicians give the other ten percent a bad reputation. - Henry Kissinger
[jQuery] how to delay operation
Hi , Am doing one support ticketing systems, user submit his problem through form , my task is after submitted , i want to send his ticketID . to his mail , for track the supprt request , The ticket ID not and sequential order , its random order , So my idea is we write one mail function , after form submited , after the 30sec , we run the mail function and get the ticket id from the DB using his emailID and based on ticket created time as the unique , ,,,no my question is , how run the mail function / any function after 30second, please advise Thanks bharani