[jQuery] Re: KFManager v1.0
Hi, Can you please share on how to config this to run in localhost. I tried but the folder and file section has the loading.gif displayed and nothing else. Thanks! On Aug 19, 7:03 am, Meroe wrote: > I was able to get this working. I'm now integrating with codeigniter > to see how it does there. > > On Aug 18, 4:06 pm, Web Specialist wrote: > > > Good job. Awesome! > > > Cheers > > Marco Antonio > > > On Tue, Aug 18, 2009 at 1:20 PM, Ken Phan wrote: > > > > KFManager (Ken's File Manager) is a plugin of jquery. It uses AJAX to > > > manage image files in a web browser and it was developed to help > > > programmer gently in the file manager. It is easy to use > > > > demo >>http://trinhvietcuong.com/ken/index.html > >
[jQuery] Re: Convert js to jquery
Hi, Thanks again, that solves my problem :-) Ciao.
[jQuery] Re: Convert js to jquery
Hi Richard, Thanks for your help, the tabs switch the class on click, but how to get the value assigned to the hidden field? Regards, Jamal
[jQuery] Convert js to jquery
Hi, I am trying to convert the below js code to jQuery format, since I am using jQuery for my site. Posted below the code, your help is appreciated. http://woork.blogspot.com/2008/01/tabbed-search-bar-using-css-and.html -- function setSearchOptions(idElement){ /* Total Tabs above the input field (in this case there are 2 tabs: mikode, user id) */ tot_tab = 2; tab = document.getElementById('tab'+idElement); search_option = document.getElementById('searchopt'); for(i=1; i<=2; i++){ if(i==idElement){ tab.setAttribute("class","selected"); search_option.value=idElement; } else { document.getElementById('tab'+i).setAttribute("class",""); } } } User ID mikode Search Contact by -- Thank you!
[jQuery] Re: How to call jQuery function inside a DOM
Hi, Thanks for the shorthand tip, what I was trying to achieve is upon sucessful validation call a function, its not a plugin. Its another function written inside the DOM. I tried adding the live syntax and it works the way I want it to but not sure if I have coded it right, code reproduced below, all of the below codes are in the same DOM ready function. What I am trying to achieve is add set of input fields for my form, so when user clicks 'add new' link the thickbox opens and you enter a name for the new field this is validated with validateNAme and if successful execute the addPhoneExt function and close the thickbox. Thanks! - function validateName(){ //if it's NOT valid if(name.val().length < 4){ name.addClass("error"); nameInfo.text("We want names with more than 3 letters!"); nameInfo.addClass("error"); return false; } //if it's valid else{ $('#addPhoneExt').live("click",(addPhoneExt)); //Added to call the addPhoneExt on successful validation $('#addPhoneExt').live("click",(tb_remove)); //Added to call the tb_remove to close the opened thickbox name.removeClass("error"); nameInfo.text("What's your name?"); nameInfo.removeClass("error"); return true; } } function addPhoneExt() { var label = $("#label").val(); //current keeps track of how many people we have. current++; var strToAdd = ': '+label+'Country Area Phone numberExt publicprivatefriendsfamilywork' $('#mainField').append(strToAdd) } -
[jQuery] How to call jQuery function inside a DOM
Hi, I am trying to call/execute a jQuery function inside of another jQuery function, the scenario is after validation of a input text field to check if its empty, if empty display a error message and if it has value then execute another function, the code as below, adapted from this link http://yensdesign.com/2009/01/how-validate-forms-both-sides-using-php-jquery/ var name = $("#label"); var nameInfo = $("#nameInfo"); //On blur name.blur(validateName); //On key press name.keyup(validateName); $("#addPhoneExt").click(validateName); //On Submitting //$("#addPhoneExt").click(function(){ //if(validateName()) //return true //else //return false; //}); function validateName(){ //if it's NOT valid if(name.val().length < 4){ name.addClass("error"); nameInfo.text("We want names with more than 3 letters!"); nameInfo.addClass("error"); return false; } //if it's valid else{ $('#addPhoneExt').click(addPhoneExt); name.removeClass("error"); nameInfo.text("What's your name?"); nameInfo.removeClass("error"); //$('#addPhoneExt').click(tb_remove); return true; } } With the above code I am able to validate the input field but what I need is to execute or call the "addPhoneExt" "tb_remove" (function to close thickBox) function //if its valid. Appreciate your help. Thanks!
[jQuery] Re: Toggle class when radio checked
Hi, Thanks it works, I have the code as below, since more than one checkbox can be selected at once I've used the click function, and also changed the radio to click function as well. This way I can get it work the way I intent to, like two option either one public or private, so for ex when selected public the label is class=hilite, so when I click on public again label class is still hilite, and when I click on private then the hilite class is removed from public and applied to private, just the way I want it to work. The idea is to hide the input using display:none, so the labels are only visible and user interacts by click on the labels and selecting the option. Once again thanks and appreciate your help, without which I couldn't have come this far. And one more (not the last ;-)) request it would be great if you can point me a novice to some good tutorial or reference for coding jQuery like a beginners guide or something basic to start with. Ciao, - $(document).ready(function(){ $("input[type=radio]:checked + label").addClass("hilite"); $("input[type=radio]").click(function () { $(this).parent().find("label.hilite").removeClass("hilite"); var id = $(this).attr("id"); $("label[for="+ id + "]").addClass("hilite"); if ( $(this).val() == "public" ) $(this).parent().find("div.tags").hide(); else $(this).parent().find("div.tags").show(); }); $("input[type=radio]:checked[value='public']").parent().find ("div.tags").css("display","none"); $("input[type=checkbox]:checked + label").addClass("hilite"); $("label").click(function () { $(this).toggleClass("hilite"); }); }); -
[jQuery] Re: Toggle class when radio checked
Hi, Thanks, you seem to be a jQuery guru, the solution works. I've applied it to work on checkbox now ;-) and now trying to have a set of checkbox display when one of the radio button is selected and hide them when another is selected. So like from below example, I select if its public or private and if private display checkbox set, I am able to hide it on load when public is selected and vice versa, but the same does not work when I change the private/public radio button, below is the code I've tried and like to know if I am on the right path. - http://code.jquery.com/jquery- latest.js"> $(document).ready(function(){ $("input[type=radio]:checked + label").addClass("hilite"); $("input[type=radio]").change(function () { $(this).parent().find("label.hilite").removeClass("hilite"); var id = $(this).attr("id"); $("label[for="+ id + "]").addClass("hilite"); }); $("input[type=radio]:checked[value='public']").parent().find ("div.tags").css("display","none"); $("input[type=radio]:checked[value='private']").parent().find ("div.tags").css("display","block"); $("input[type=checkbox]:checked + label").addClass("hilite"); $("label").click(function () { $(this).toggleClass("hilite"); }); }); Radio Toggle label { color:black; margin:5px 1px; cursor:pointer;padding:2px 5px; } label.hilite { background:blue;color:white; } public private friends family work public private friends family work - And also the hilite class get applied to radio I select, but when I click on the checked radio again the hilite class is removed even though the radio is checked, is there a way to keep the hilite class applied as long as the radio button is checked. Thanks!
[jQuery] Re: Toggle class when radio checked
Hi, Thanks it worked like charm, but when I have a series of radio in groups, the class is applied to only one radio from the two sets, in below example there are two forms with radios, I am trying to have checked one with hilite class in both the forms, hope I am explaining myself well cause I sound like confused ;-) check me checkme not check me checkme not Thanks again!
[jQuery] Toggle class when radio checked
Hi, I just started using jQuery and am trying to achieve the below; Two radio button, when I click on any one the label for checked radio class should change, and when I click other one the label class should change here while the unchecked should fall back to default class. Below is the code I tried it applies the class but then it does not revert back to default when other radio button is checked. Any help is appreciated. Thank you! --- http://www.w3.org/1999/xhtml";> http://code.jquery.com/jquery- latest.js"> $(document).ready(function(){ $("input:checked + label").addClass("hilite"); $("label").click(function () { $(this).toggleClass("hilite"); }); }); Radio Toggle label { color:black; margin:5px 1px; cursor:pointer;padding:2px 5px; } label.hilite { background:blue;color:white; } check me check me not ---