[jQuery] Re: .serialize and form elements in tables
I haven't set breakpoints before - will follow that up now - but if it helps, my code is function saveForm(ej) { var temp=new Array(); alert(ej); temp=ej.split('*'); var sct = temp[0]; var fID = temp[1]; alert('#'+sct); var str = $('#'+sct).serialize(); alert(str); $.ajax({ } ej comes in as the id of the form and a record identifier as formID*recordID The first two alerts are "filled" appropriately, the third one is empty. Yet, if I drop the table structure around the form elements, everything works properly. Thanks, Bruce At 02:07 p.m. 4/10/2008, you wrote: So are you calling it via $("#processthis").serialize()? Serialize doesn't fire, you just call it. If you set a breakpoint in Firebug in serialize, does it ever get there?
[jQuery] Re: jQuery.getJSON ajax loading
it doesnt work ... the block and unblock was to fast ... now i use ajaxStart and ajaxStop and it work well ;) On Oct 4, 5:39 am, MorningZ <[EMAIL PROTECTED]> wrote: > Use a plugin like blockUI > > http://malsup.com/jquery/block/ > > then it's as easy as having a div wrapped around your UI like: > > > your content . > > > and then when you call your getJSON method: > > $("SomeButton").click(function() { > $("Page_Block").block(); > $.getJSON( > "somepage.html" > { Params }, > function(result) { > ... your success code > $("Page_Block").unblock(); > } > ); > > }); > > On Oct 3, 1:29 pm, Adwin Wijaya <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I need to add ajax loading before jQuery.getJSON loaded ... because on > > some user, the connection was pretty slow and they needs to wait for > > several seconds... > > > please tell me how to add ajax loading message (i will supply with the > > image and overlay div) before getJSON loaded and after getJSON > > finished. > > > thanks
[jQuery] Re: Double-click and toggle
If an is single clicked, nothing should happen. If it is double clicked, it will perform a certain action on the element. If it is double clicked again, the will revert back to normal. On Oct 3, 9:59 pm, Dave Methvin <[EMAIL PROTECTED]> wrote: > Can you describe what you want to happen? For example, "When an li > element is double-clicked, it should _. If it is single-clicked > the first time it should ___ and the second time it should _. If > it is single-clicked but then double-clicked it should ." > > Also, remember that a click event is always delivered before a double- > click. (It doesn't know you meant to double click until it's already > delivered the click.)
[jQuery] Re: .serialize and form elements in tables
I appreciate the input (no pun intended!) but that workaround didn't do the job. Cheers, Bruce At 01:54 p.m. 4/10/2008, you wrote: a quick workaround that springs to mind is $ ("#form :input").serialize(); On Oct 3, 6:26 pm, Bruce MacKay <[EMAIL PROTECTED]> wrote: > Hello folks, > > I've been successfully using .serialize() to prepare input data when > my form has the structure > > Your name id="d1" type="text" name="dStartDate"> etc... > > > However, if the input elements are enclosed within a table structure > within the form, like so ... > > Your > name etc.. > > > ... the serialize call doesn't do the necessary preparation - it > doesn't appear to fire at all. > > There is something obviously wrong with my approach (and removing the > table is not a solution - its use is appropriate to the contents of > the form), but I cannot find any clues in the jQuery documents or > this list's archives. > > I'd appreciate some illumination here. > > Thanks, > Bruce
[jQuery] Re: .serialize and form elements in tables
Thank you Dave. The tables were formed fine (I'd checked that) but I had managed to include duplicate form IDs in the page and once that was fixed, the .serialize() is now working as expected. Cheers, Bruce At 02:54 p.m. 4/10/2008, you wrote: That code looks okay. Have you run the HTML through the W3C validator? Maybe you're missing a tag somewhere.
[jQuery] Re: NEW PLUGIN (beta): ContextMenu
Nice work, Matt. I'm sure that will come in handy! Thanks for sharing it! Rick From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Karl Swedberg Sent: Thursday, October 02, 2008 8:18 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: NEW PLUGIN (beta): ContextMenu excellent work, Matt! --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 2, 2008, at 6:50 PM, Matt Kruse wrote: I've been working on a new Context Menu plugin. I know some exist, and I've used them, but I've always wanted something better. Here is mine: http://www.javascripttoolbox.com/lib/contextmenu/ This is at a pre-beta stage right now. Not ready to be used, but I would love to hear what people think. I still need to finish the examples, write some more documentation, and package it up a little better. I expect to have it at "Version 1.0" in a few days. Hopefully the examples on that page will show you what it can do and you can see the source to critique it. I wrote this primary for my own use, but I think that a lot of people might find it useful. I welcome any feedback! Thanks! Matt Kruse
[jQuery] Re: Double-click and toggle
Can you describe what you want to happen? For example, "When an li element is double-clicked, it should _. If it is single-clicked the first time it should ___ and the second time it should _. If it is single-clicked but then double-clicked it should ." Also, remember that a click event is always delivered before a double- click. (It doesn't know you meant to double click until it's already delivered the click.)
[jQuery] Re: .serialize and form elements in tables
That code looks okay. Have you run the HTML through the W3C validator? Maybe you're missing a tag somewhere.
[jQuery] Double-click and toggle
Hello, I've been trying to figure out how to combine double-click and toggle but haven't had any luck. Here's what I have so far: $("li").dblclick(function() { $(this).toggle(function() { $(this).doSomething(); }, function() { $(this).backToNormal(); }); }); Any ideas why this doesn't work?
[jQuery] Re: How can I to traverse a html doc starting at a form element to get an element inside a ?
It that is valid XHTML/HTML you can simply do $('#h').html() Going straight to the ID is the fastest selector available. If that is not what you want: $('.frmRowOuter input') will suffice or $('.frmRowOuter > .frmRowField > input') (slower and unnecessary) Read all about how jQuery selectors work here: http://docs.jquery.com/Selectors And about CSS selectors: http://www.w3.org/TR/CSS2/selector.html http://www.w3.org/TR/css3-selectors/ cheers, - ricardo On Oct 2, 4:14 pm, VictorM <[EMAIL PROTECTED]> wrote: > Hello, > > I am new to JQuery and I am having problems to traverse a HTML > document. What I want to accomplish is to get an element with > id = h that is inside a . This input element is part of a > element. So far I have tried the following jqueries without > success: > > 1. - $("form#frmSceneData > > div.frmRowOuter").children("div.frmRowField") > .show().html() > > 2.- $("form#frmSceneData").find ("div.frmRowField") > .show().html() > > Applying the following jquery I am getting part of what I want. The > problem is traversing the rest of the form element from this point > down to get " onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=110 name=h>" > > Here is what I am getting so far with the following jquery $ > ("form#frmSceneData") > .show().html() : > > > > Scene Name > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=1234new_SavedAsTest name=scenename> > > > sceneid > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=13715 name=sceneid> > > > basesceneid > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=13387 name=basesceneid> > > > advid > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=16176 name=advid> > > > templateid > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > name=templateid> > > > h > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=110 name=h> > > > w > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=172 name=w> > > > image1 > onchange='javascript:document.getElementsByName("image1")[0].value = > this.value; > window.myPlaylistSceneEditorSection.onAttributeChanged(this);' > name=image1file> > > > image1 > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > name=image1> > > > textbox1 > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value='" text"' name=textbox1> > > > textbox2 > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=sadasd name=textbox2> > > > textbox3 > onchange=javascript:window.myPlaylistSceneEditorSection.onAttributeChanged(this); > value=sadsad name=textbox3> > > Any help will be appreciated > > Thanks > > VictorM
[jQuery] Re: argument list
> function nextPage(clicker) { > $(clicker).click(function () {... Inside the click handler, the "this" variable is the DOM element that was clicked. Try alert(this.id) and you'll see what I mean.
[jQuery] Re: .serialize and form elements in tables
So are you calling it via $("#processthis").serialize()? Serialize doesn't fire, you just call it. If you set a breakpoint in Firebug in serialize, does it ever get there?
[jQuery] Re: .serialize and form elements in tables
a quick workaround that springs to mind is $ ("#form :input").serialize(); On Oct 3, 6:26 pm, Bruce MacKay <[EMAIL PROTECTED]> wrote: > Hello folks, > > I've been successfully using .serialize() to prepare input data when > my form has the structure > > Your name id="d1" type="text" name="dStartDate"> etc... > > > However, if the input elements are enclosed within a table structure > within the form, like so ... > > Your > name etc.. > > > ... the serialize call doesn't do the necessary preparation - it > doesn't appear to fire at all. > > There is something obviously wrong with my approach (and removing the > table is not a solution - its use is appropriate to the contents of > the form), but I cannot find any clues in the jQuery documents or > this list's archives. > > I'd appreciate some illumination here. > > Thanks, > Bruce
[jQuery] Re: hover question
I'll check out livequery. On Oct 2, 6:19 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > The livequery plugin (http://brandonaaron.net/docs/livequery/) might > help you. You only bind the hover function once for a selector, and > all TR's subsequently added to the tables will have the event covered > with no need to bind it again. > > And just so you know, this > tbody.hover(function () { > // over > // wish rows will be exposed on 'out' (it won't) > var rows = $(this).children('tr'); > tr.addClass('hovered'); > }, function () { > // out > rows.removeClass('hovered'); // this doesn't work > }); > > doesn't work because the 'rows' var is only known inside the first > function. You have to either declare it again on the other one or use > the jquery object directly. > > - ricardo > > On Oct 2, 5:44 pm, Brad <[EMAIL PROTECTED]> wrote: > > > Leonardo, > > > I looked at my actual code again and wondered what would happen if I > > bound the hover at the end of the loop. Your recommendations partially > > work if I do that. Since each tbody can have a variable number of > > rows, my intent is to highlight all rows when hovered. Your examples > > only highlight the first row, which isn't the desired affect. I could > > simply style the whole tbody, but the results when doing that are > > undesirable. > > > I'm most likely dealing with a special case here with some unusual > > requirements. In most cases I would expect your recommendations to > > work. > > > Thanks Again > > > On Oct 2, 2:25 pm, Brad <[EMAIL PROTECTED]> wrote: > > > > That doesn't work in my case, but thanks again for the > > > recommendation. I should note that the code > > > > // Insert HTML row into table > > > var tbody = $('').appendTo('#' + target_id + ' table'); > > > tbody.attr('id','id-' + row.shipment_id); > > > > // This will highlight a tbody's rows on mouseEnter. > > > // The original row coloring will be restored on mouseLeave. > > > // A tbody may have numerous rows. > > > > tbody.hover(function () { // <-- tbody is a jQuery function > > > $(this).children('tr').addClass('hovered'); > > > }, function () { > > > $(this).children('tr').removeClass('hovered'); > > > }); > > > > is part of a larger loop. I'm binding the hover to each tbody as it is > > > dynamically inserted into the table. > > > > My original example, does work. I was just looking for a way to make > > > the code smaller. > > > > Thanks > > > > On Oct 2, 2:01 pm, "Leonardo K" <[EMAIL PROTECTED]> wrote: > > > > > Try this: > > > > > $(tbody).find('tr').hover(function () { > > > > $(this).addClass('hovered'); > > > > }, function () { > > > > $(this).removeClass('hovered'); > > > > }); > > > > > On Thu, Oct 2, 2008 at 16:39, Brad <[EMAIL PROTECTED]> wrote: > > > > > > Leonardo, > > > > > > I should have shown some more code. In my original example, tbody is a > > > > > reference to an jQuery object. > > > > > I'm working with a page that has many tables. Each table can have many > > > > > elements. The number of rows in each can vary, but in > > > > > all case there is more than 1. Unfortunately the site is behind a > > > > > firewall or I'd give a page. > > > > > > // Insert HTML row into table > > > > > var tbody = $('').appendTo('#' + target_id + ' table'); > > > > > tbody.attr('id','id-' + row.shipment_id); > > > > > > // This will highlight a tbody's rows on mouseEnter. > > > > > // The original row coloring will be restored on mouseLeave. > > > > > // A tbody may have numerous rows. > > > > > > tbody.hover(function () { // <-- tbody is a jQuery function > > > > > $(this).children('tr').addClass('hovered'); > > > > > }, function () { > > > > > $(this).children('tr').removeClass('hovered'); > > > > > }); > > > > > > What I was curious about is if I could do something like the > > > > > following, which doesn't work. > > > > > > tbody.hover(function () { > > > > > // over > > > > > // wish rows will be exposed on 'out' (it won't) > > > > > var rows = $(this).children('tr'); > > > > > tr.addClass('hovered'); > > > > > }, function () { > > > > > // out > > > > > rows.removeClass('hovered'); // this doesn't work > > > > > }); > > > > > > Your example inspired me to try > > > > > > $(tbody).children('tr').hover(function () { > > > > > $(this).addClass('hovered'); > > > > > }, function () { > > > > > $(this).removeClass('hovered'); > > > > > }); > > > > > > but that doesn't work either. > > > > > > Thanks > > > > > > On Oct 2, 11:56 am, "Leonardo K" <[EMAIL PROTECTED]> wrote: > > > > > > $('tbody tr').hover(function () { > > > > > > $(this).addClass('hovered'); > > > > > > }, function () { > > > > > > $(this).removeClass('hovered'); > > > > > > });
[jQuery] .serialize and form elements in tables
Hello folks, I've been successfully using .serialize() to prepare input data when my form has the structure Your nameid="d1" type="text" name="dStartDate"> etc... However, if the input elements are enclosed within a table structure within the form, like so ... Your name etc.. ... the serialize call doesn't do the necessary preparation - it doesn't appear to fire at all. There is something obviously wrong with my approach (and removing the table is not a solution - its use is appropriate to the contents of the form), but I cannot find any clues in the jQuery documents or this list's archives. I'd appreciate some illumination here. Thanks, Bruce
[jQuery] Re: SimpleModal wierdness
Actually, the error is being caused by the issue mentioned: http://groups.google.com/group/jquery-dev/browse_thread/thread/aabf160d9980e52d/c74b19cc8c63f996 In SimpleModal, you can get around the issue by adding persist:true : $('#modalwikivideo').modal({persist:true}); That will prevent SimpleModal from cloning your video object and prevent the error. -Eric On Oct 3, 10:18 am, ricardobeat <[EMAIL PROTECTED]> wrote: > IE events do not support the preventDefault method. > > With jQuery you can simply return false to cancel the event: > > $('.signup').click(function (e) { > $('#modalwikivideo').modal(); > return false; > }); > > - ricardo > > On Oct 3, 7:28 am, willard <[EMAIL PROTECTED]> wrote: > > > Hi folks.. I can't fathom this out. > > I have an image which looks like this: > > > > > and a bit of javascript with simplemodal that looks like this: > > > $(document).ready(function () { > > $('.signup').click(function (e) { > > e.preventDefault(); > > $('#modalwikivideo').modal(); > > }); > > > }); > > > The problem is it works fine in safari, firefox but Not IE. On > > clicking the image, IE gives the rather unuseful error: Object doesn't > > support this property or method > > > (It can be seen at:http://otwikiflash.net/action/wikipedia) > > > Any ideas what IE is moaning at?? > > > Thanks! This is doing my head in..! > > W
[jQuery] Re: jQuery.getJSON ajax loading
Use a plugin like blockUI http://malsup.com/jquery/block/ then it's as easy as having a div wrapped around your UI like: your content . and then when you call your getJSON method: $("SomeButton").click(function() { $("Page_Block").block(); $.getJSON( "somepage.html" { Params }, function(result) { ... your success code $("Page_Block").unblock(); } ); }); On Oct 3, 1:29 pm, Adwin Wijaya <[EMAIL PROTECTED]> wrote: > Hi, > > I need to add ajax loading before jQuery.getJSON loaded ... because on > some user, the connection was pretty slow and they needs to wait for > several seconds... > > please tell me how to add ajax loading message (i will supply with the > image and overlay div) before getJSON loaded and after getJSON > finished. > > thanks
[jQuery] Re: Mootools and Jquery conflict
You've got "$j" being used in the last block, but no where do you define what "$j" is so, right after your line tell the page what "$j" is supposed to mean: var $j = jQuery.noConflict(); All this is clearly laid out right on this Wiki page http://docs.jquery.com/Using_jQuery_with_Other_Libraries On Oct 3, 5:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey guys, > sorry to bother you with this one, I read the pages about the > nonconflict script etc,...but I 've spent the whole day trying to > figure out how to solve this. > > Basicly I have a script made on a mootools library. > I now want to add jQuery's Fancybox to the page. When I do this my > mootools accoridon style menu won't work anymore. > When I delete the jQuery.js file it works again. > I understand its a problem with the '$' which is used in both scripts. > But I really cant find the way to solve it by using the nonconflict > way. > > I will post the code I have in my head. > Only the last rules of the script are jQuery lines. > All the rest is either the mootools script, and a dynamic content > script I use (but this one doenst hav any conflict with either > mootools as jQuery. > > I really hope someone can get me on my way since I am quite a beginner > in javascript. > Thanks > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > > > script> >