[jQuery] Re: (validate plugin) dependency callback not being triggered
Thanks Jules I'll give it a try now. I was looking for something that would trigger the validation but I thought it was automagically triggered onblur/keyup but perhaps thats only after the initially validate via submit * thanks for the typo spotting!.. totally missed that ta Brad On Nov 6, 11:14 am, Jules jwira...@gmail.com wrote: Hi, Validation only triggered if you call submit the page or call the $ (form).valid() function. I didn't see any submit() or $ (form).valid() call in your page. Try adding this to your page js script inside ready() $(#validateMe).click(function(){ if($(form).valid()) alert(All data are valid); else alert(Invalid data); }); html input type=button id=validateMe name=validateMe value=Validate / Hope this help. BTW: you misspelled territory in ACT :) On Nov 6, 12:06 pm, Brad Hile brad.h...@gmail.com wrote: Bump Hi I've tried every way I can think of to use dependency to enable additional elements to be required and have had no luck at all. I simply want to enable required on a number of fields when a specific radio button is selected and for it to be disabled when its not. (These fields are hidden when the radio button is deselected) I've tested the response from the functions and it appears correct but after hours of staring at this I just can't figure it out. Help.. please? original code is onhttp://promotionalpenshop.com.au/testorder.php?p=4 though I may have changed it by the time you look at this. So basically I've tried an inline function something like: organisation:{required: function(element) { return $(.payment_type:checked).val() == 'invoice'); } } - - - - - - - - - - - - - - Setting a var to true/false when the radio button is clicked and testing that: var invoice; $(.payment_type).change(function () { if($(this).val() != 'paypal'){ $(#paybyinvoicefields).slideDown('slow'); invoice = true; } else { $(#paybyinvoicefields).slideUp('slow'); invoice = false; } organisation:{required: invoice} - - - - - - - - - - - - - - Using an enternal function organisation:{required: invoiceme() } function invoiceme() { return ($(.payment_type:checked).val() == 'invoice')? true : false; }
[jQuery] Re: (validate plugin) dependency callback not being triggered
Bump Hi I've tried every way I can think of to use dependency to enable additional elements to be required and have had no luck at all. I simply want to enable required on a number of fields when a specific radio button is selected and for it to be disabled when its not. (These fields are hidden when the radio button is deselected) I've tested the response from the functions and it appears correct but after hours of staring at this I just can't figure it out. Help.. please? original code is onhttp://promotionalpenshop.com.au/testorder.php?p=4 though I may have changed it by the time you look at this. So basically I've tried an inline function something like: organisation:{required: function(element) { return $(.payment_type:checked).val() == 'invoice'); } } - - - - - - - - - - - - - - Setting a var to true/false when the radio button is clicked and testing that: var invoice; $(.payment_type).change(function () { if($(this).val() != 'paypal'){ $(#paybyinvoicefields).slideDown('slow'); invoice = true; } else { $(#paybyinvoicefields).slideUp('slow'); invoice = false; } organisation:{required: invoice} - - - - - - - - - - - - - - Using an enternal function organisation:{required: invoiceme() } function invoiceme() { return ($(.payment_type:checked).val() == 'invoice')? true : false; }
[jQuery] Re: SuperFish Arrows
it's set in the css file at the bottom. Just change the file name and dimensions to suit On Apr 24, 12:09 am, Praveen praveen.rajendrab...@gmail.com wrote: How is the arrows displayed in the superfish menus? If I would like to change to an image of my choice, how do I go about? Regards, Praveen
[jQuery] photoshop like image navigator
Just wondering if anyone can point me in the right direction for something that works a bit like the image navigation in Photoshop? I'm working with a large image and need a way for a user to be able to zoom it in and out and view the large image in relation to a thumbnail. The magnify plugin from Josh Nathanson (great plugin!) is nearly there but I need the large image visible initially and ideally be able to zoom in and drag around. thanks in advance Brad
[jQuery] Re: php mysql
I'm certainly not a jquery.guru but do use jquery for database update (php/mysql) I think from your post your thinking of jquery in the same league as server side languages like php ruby and its not. Its client side javascript with all the restrictions that brings but a much nicer way of dealing with it. Ashley's mention of understanding how you would do it using standard forms is really good as you are essentially enhancing not replacing that. jquery will still send information in much the same way as a form would though with the benefit of extracting page info from the DOM not just in form fields, not refreshing the page and hiding a lot of the background work. so for a very simplified psuedocode example in a row you want to update. Use jquery to grab the data in the row with something like $ (this).parent('td').text then put into a post call and use the callback to check the response from the php script which does the work with the database update $.post(, { name: data from row }, function(data){ if(data == 'crapped out') { alert(Damn it the script + data); } else { alert(Hey it worked, the database row is + data); } }); In your_script_that_works_with_the_sql.php you would check the post values and work with them exactly as you would with a standard form then just echo out the response to the update which gets sent back as the callback data. eg. if($result) { $return = 'updated'; } else { $return = 'crapped out'; } exit($return); On May 6, 8:57 am, John [EMAIL PROTECTED] wrote: I have the same question. I have over 20k rows of data in mysql, and the idea is for there to be an update button beside each row. I don't see any examples of how to interact with the database here -- in php it's $sql = ...; in ruby/rails it's Thing.new[...], but what's up with jquery? I don't think an explanation would be voodoo - it'd be a lifesaver. I already understand the old ways - school me on the jquery. Thanks John This is a pretty big question. What you need to do is learn how to do it with regular HTTP interaction with the backend. Once you understand that you'll be able to adapt it to Ajax. A firm grounding in HTTP makes XHR pretty straightforward. Doing this right is not simple. You should probably read up on REST and understand which parts should GET and which parts should POST (or really even PUT/DELETE but that's often unused due to bad support and general lack of understanding). The take away point is that if you don't know how to do every part with regular forms and backend interaction already, doing it in Ajax will seem like insurmountable voodoo.
[jQuery] Re: how to build a image cycle?
To loop Jcarousel you need to set the wrap option and cycle the auto option The following will show 5 images(visible:5), advancing 1 image (scroll: 1) every 2 seconds (auto:2) and when it reaches the last image wrap back to the first (wrap:last). // set up the carousel jQuery('#mycarousel').jcarousel({ visible: 5, auto: 2, scroll:1, animation: 'slow', wrap: 'last' }); check out the following for explanations and more options http://sorgalla.com/projects/jcarousel/#Getting-Started You can control the size of the image displayed in the CSS file and I would imagine you could turn off the arrows Hope that helps. Brad PS Cycle plugin is really cool but not sure what sort of performance hit (if any) running multiple instances would cause On Jan 24, 3:11 am, DoZ [EMAIL PROTECTED] wrote: Hi all! I simply need to build an image rotation/cycle; it has to be vertical, automatic, looping, and the images have to be in a tags. Jcarousel could be quite enough for me (even if I don't need arrows), but I don't understand how to make the loop.http://sorgalla.com/projects/jcarousel/ ScrollShow could be good too, but ther's no documentation(!)http://flesler.blogspot.com/search/label/jQuery.ScrollShow Can anybody help me??
[jQuery] Re: preventing open element from being closed and reopened in accordion menu (not using accordion plugin)
Was just reading another post Trying to show a div on mouseover of menu item... and pointed me to the solution The answer: if ($(this).parent().next().is(':hidden')) On Jan 13, 11:03 am, Brad Hile [EMAIL PROTECTED] wrote: Hi I have a simple accordion menu and would like to prevent the already open dd from being closed and reopened when clicked on. eg. $(#menu dt a).click(function(){ // only activate if dd is hidden so currently active block is not reopened if(hidden???) { $(#menu dd:visible).slideUp(slow); } $(this).parent().next().slideDown(slow).addClass(open); return false; }); Can anyone suggest how to test the state of the current element I'm guessing $(this).parent().next().something? but don't know how to get its current state thanks Brad
[jQuery] preventing open element from being closed and reopened in accordion menu (not using accordion plugin)
Hi I have a simple accordion menu and would like to prevent the already open dd from being closed and reopened when clicked on. eg. $(#menu dt a).click(function(){ // only activate if dd is hidden so currently active block is not reopened if(hidden???) { $(#menu dd:visible).slideUp(slow); } $(this).parent().next().slideDown(slow).addClass(open); return false; }); Can anyone suggest how to test the state of the current element I'm guessing $(this).parent().next().something? but don't know how to get its current state thanks Brad
[jQuery] Re: jCarousel + slideshow effect?
Hi Bryan, I've been tinkering with something along the same lines for awhile now unfortunately your url was truncated so i'm not 100% certain this is the same as the example you gave but take a look http://www.robertalla.com/new/newgaltest.php?g=1 I'm still getting my feet wet with jquery but its starting to get somewhere. (Any jquery ninjas feel free to suggest changes optimisations !) Currently it can extract the link from the carousel image, load the image while displaying a loading graphic then animate (fade) in the selected image I also preload the images for the first thumbnails displayed and the jcarousel auto scroll function can work like a slideshow to trigger the loading of the images sequentially (needs more work though) todo: control the slideshow with a toggle link add another callback function prior to the image being loaded to check if its already displayed make the height of the big image container stay the same as the last image so it doesn't jump so much when changing images maybe add optional captions from the thumbnail title tidy optimise Hope this is of some help to you Regards Brad On Dec 18 2007, 10:49 pm, Bryank [EMAIL PROTECTED] wrote: I must say thejCarousellocated here is fantastic:http://sorgalla.com/jcarousel/ Now, The effect with the thickbox is nice, but I would love it if there was a Jquery plugin that mixedjCarouselwith SlideViewer. So basically, on this page:http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/i... you where all the numbers are clickable to initiate the slide effect, the numbers would be thumbnails of the all the possible image choices, but those thumbnails would be inside ajCarouseleffect. Basically, replace the numbers onhttp://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/i... withjCarouseland it would be done? Is there an existing solution like that, or can someone may whip up an example of how that can be done? Thanks, Br yan
[jQuery] Re: using jcarousel as image viewer - how to load large image onclick with loading animation
Hi maddog I had to change things a bit but did manage to get click events working by using the jcarousel class assigned to each image $(.jcarousel-item).click( function() { // do stuff return false; }); Hope that helps you Brad On Nov 20, 11:09 pm, maddog [EMAIL PROTECTED] wrote: Did you find a solution? I would need a click-event on the jcarousel- images - so it's nearly the same problem... Thanks for any advice... Michael On 6 Okt., 06:39, aussiebob [EMAIL PROTECTED] wrote: I'm trying to use the excellentjcarouselplugin to create an image viewer/slideshow for a friends site I am a real newbie my first post so go easy on me :) Can someone point me in the right direction how to load an image on demand with some sort of callback so a loading image can be displayed and the image fade in when ready. Currently I'm preloading all images which is so-so but definitely not ideal and the fade doesn't work correctly if an image is not loaded Is this heading in the right direction? $(.jcarousel-item).click( function() { s =$(this).children(a).attr(href); a =$(this).children(a).attr(title); // switch $(#large).fadeout(); $(#loader).show(); //load and get some sort of return when loaded // to turn off loading and fade in image // psuedocode loaded = function(){ return $(#large).bind('load', function() { if(s) this.src = s; }).trigger('load'); } // psuedocode if(loaded) { $(#large).attr({ alt: a}); $(#loader).hide(); $(#large).fadeIn(slow); } }); I'm trying to achieve: a. When the user clicks on the thumbnail it gets the link href title and uses them to set the src alt tag on the main image. (DONE) b. Next image should fadein without flashing the same image (DONE not very well) currently using $(#large).hide().attr({ src: s, alt: a}).fadeIn(slow); // this only works if the image has totally loaded otherwise the old image fades in then it switches c. Preload the first x number of main images to match the initially displayed thumbs with the remainder loading on demand and showing a loading animation (NOT DONE) Thanks very much for any and all help Brad