[jQuery] Re: How to select one of the many forms i have

2009-04-25 Thread Raja Koduru

i think it should be
$(form[name=formb]) not forms...

On Sat, Apr 25, 2009 at 1:39 AM, funkyasl amritas...@gmail.com wrote:

 Hi all,
 I'm a jquery newbie. I've been searching around the web a lot, but
 could not find an answer.

 My page has multiple forms (forma, formb, formc, etc). I want to
 select one particular form, say formb, without assigning an id to it,
 just by its name itself. How can i achieve this?
 I've tried:
 $(forms[name=formb])
 but it doesnt work.

 My actual motive is to get hold of a radio group in this form, so that
 i can assign a click event to it.
 Something like:
 $(forms[name=formb] myselect).click(function(){
        alert(radio selected:  + this.value);
 });
 I have no idea how to do this. I'm sure there must be some way to do
 this without assigning ids to it.

 Please help me. Thanks in advance :)





[jQuery] Re: can jquery capture these events all in one: user closes browser window/tab, or leaves my domain?

2009-04-17 Thread Raja Koduru

On Fri, Apr 17, 2009 at 3:25 AM, Govinda govinda.webdnat...@gmail.com wrote:

 Hi all,

 I am brand new here.  Except for quick installs of pre-written scripts
 over the years, I have very little experience of javascript (do we use
 the acronym js here?)  I have written in visual basic (I was last
 semi-fluent with the 1998 version), and in WebDNA for 10 years (server-
 side web scripting language, like PHP, only much less known).

 I am writing to ask your opinions about accomplishing a solution to
 our need.  I am not sure if we can do this with jQuery or js?

 Here is what I need your opinion about how to solve:
  We have a series of forms for the user to submit.  We gather various
 data from the user at each form.  We save his input to disk at every
 form submission but also eventually want to do some final processing
 on his input (do some math, over and above just saving his input).  We
 only want to process his data once we have accumulated as much data
 from his as possible.. i.e. as much as he has patience to input for
 us.  *One special thing is that we can only do this final processing
 one time.*  Ideally we want to wait until he reaches formN to do this
 final processing of his data.  But if we knew he was only going to
 stick around to see form3 and then leave..  then we would simply do
 the final processing after he submitted form2.  The problem is that we
 never know when the user will get tired and leave.  We would do the
 final processing earlier before losing him, but we can only process
 once and we don't want to miss the chance to gather yet more data from
 him before we process.  If he leaves our site at form2 (or form3, or
 form4, for example) then we want to process whatever data we have
 gathered from him in total...  meaning *as if he had submitted the
 form* he is now looking at after having checked the checkbox which
 says this is my last form!.  We want to process as though he
 submitted one last form after alerting us that it was going to be his
 last submission - even though he is actually now leaving our site by
 closing the browser window, or closing the browser tab, or entering a
 new URL to go to..  or using a browser bookmark ..
   I assume there is a way to capture the event that fires when
 someone closes the browser window, closes the tab, (or also even if he
 just leaves our domain within the current window/tab?)..?
   Can I capture all these possible events (and others that you can
 think of that I neglect to mention here) into one umbrella event that
 fires and effectively submits the current form one last time - thus
 signaling to our server to go ahead with the final processing?

 If  jQuery does not have this capability, then what about javascript?
 Please advise!

 Thanks for your time reading this.
 -Govinda


Try unload event on body tag.

you even try jquery way.
$(window).unload(function {
//whatever you want to do
});

refer: http://docs.jquery.com/Events/unload#fn

-raja koduru


[jQuery] Re: How to select sub element text on clicking the parent element.

2009-04-17 Thread Raja Koduru

*
var answer_text = $(ul li, this).text();
alert(answer is  + answer_text);



does this help?

-raja koduru


[jQuery] Re: [autocomplete] Submit form on click result

2009-04-17 Thread Raja Koduru

Dan,
Do you want an ajax post or form submit
Can you provide some information on what you are looking for?

- raja koduru

On Fri, Apr 17, 2009 at 4:44 PM, dajaniel daniel.howe...@googlemail.com wrote:

 Hi there,

 My jquery is pretty sketchy so I was wondering if anybody knew how to
 submit the form that the search field appears in on click of a result
 (after having populated the textfield and any other fields)? Not sure
 how to do this...

 Thanks!

 Dan.



[jQuery] Re: Adding properties to $.ajax(options)

2009-04-17 Thread Raja Koduru

don't see any..
what is the error you are experiencing?

- raja koduru

On Fri, Apr 17, 2009 at 5:30 PM, blasto333 m...@chrismuench.com wrote:

 $.ajax({
 type: GET,
 url: prefix+url,
 success: script_saved,
 custom_property : someVar
 });

 Is there anything wrong with this?


[jQuery] Re: Setting a newly inserted option as the selected option

2009-04-17 Thread Raja Koduru
$(#refSelectBox option[text^= + author + ]).attr(selected,selected);

I guess the above is doable.
let me know.

- raja koduru

On Thu, Apr 16, 2009 at 11:16 PM, Nando d.na...@gmail.com wrote:

 I'd like set a newly inserted option in a select box as the selected
 option. I'm trying to use jQuery to select the option using the option
 text, which begins with the author name as defined in the function.

 In the examples I've found, $(#refSelectBox option[text^=author])
 would presumably select any option that begins with the literal
 author, but I need it evaluated instead.

 Given the following ...

 $(#addRefForm).submit(function() {
                        var author = $(#author).val()
                        var detail = $(#detail).val()
                        var refYear = $(#refYear).val()
                        var refType = $(#refType option:selected).val()
                        var newReference = 1
                        $.post('index.cfm?view=saveReferenceFromPopup', {
                                author:author,
                                detail:detail,
                                refYear:refYear,
                                refType:refType,
                                newReference:newReference
                                },  function(data,status) {
                                        if(status == 'success'){
                                                 
 $(#refSelectBox).trigger('refreshOpts');
                                                 $(#refSelectBox 
 option[text^=author]).attr
 (selected,selected);
                                          }
                                  }
                        );

                        $('#dialog').dialog('close');
                        return false;
                });

 ... how to select the newly inserted option in #refSelectBox using the
 text attribute and set it to the selected option?

 Any alternate suggestions are most welcome!

 Thanks,
 Nando


[jQuery] Re: .navButtonAdd Quick Question...

2009-04-17 Thread Raja Koduru

Can you provide more details.

Feels like doable just by fiddling with class attribute

-- raja koduru
On Thu, Apr 16, 2009 at 9:40 PM, briandus bri...@virtual-essentials.com wrote:

 Hi there - I'm adding a custom button using the .navButtonAdd
 function. I see that there is an option for an image, but I'm
 wondering if I can create a button and apply a class instead. I have a
 toggle button that I'm adding and the image will change with the
 toggle state. Is this possible?

 Thanks!


[jQuery] Re: Error messages is repeating !!

2009-04-17 Thread Raja Koduru

name collision could be a reason

like a function and a variable(non function) having same name..and you
try to call the variable

provide more info on the problem you are facing

-- raja koduru

On Thu, Apr 16, 2009 at 9:02 PM, akmsharma amit.mca...@gmail.com wrote:

 Hi ,


 Frnds I had encountered a unusual problem in one of the forms I had
 validated through jQuery in my prjt.

 The  error messages are getting repeated if I keep presing the submit
 button without entering any value.

 any the form gets as many error messages as many time I click the
 submit button .


 Any sugesstion will be a welcome

 Thanks

 Amit



[jQuery] Re: how can I delete all elements: children and parent

2009-04-16 Thread Raja Koduru

$(#57).parent().empty()

could work.
check here: http://docs.jquery.com/Manipulation

On Thu, Apr 16, 2009 at 6:01 PM, dziobacz aaabbbcccda...@gmail.com wrote:

 I have:

 span id='57'

 bla bla bla br/
 a href='#'  something1 /abr/
 a href='#' onclick='clickk(57); return false;' DELETE /a
 br/br/

 /span

 How can I delete span element with id=57 and also everything inside ?


[jQuery] Re: Highlight a table row on radio button click

2009-04-16 Thread Raja Koduru

Nitin,
paste some code/snippets here.
Will help us to help you.
-raja

On Thu, Apr 16, 2009 at 5:48 PM, Nitin Gautam gautam.ni...@gmail.com wrote:

 I have a table in which each row has radio botton in first td.
 I have to make a code so that when user click on radio button that row
 get highlighted .
 When click other that get highlighted  and rest without highlight



[jQuery] Re: how can I delete all elements: children and parent

2009-04-16 Thread Raja Koduru

mkmanning,
you are right.
my mistake.
-raja

On Thu, Apr 16, 2009 at 9:38 PM, mkmanning michaell...@gmail.com wrote:

 But won't work if the parent element contains other elements. Why not
 just use .remove() on the span? Btw, an ID that is a number (or starts
 with a number) is invalid.

 On Apr 16, 6:21 am, Raja Koduru kscr...@gmail.com wrote:
 $(#57).parent().empty()

 could work.
 check here:http://docs.jquery.com/Manipulation

 On Thu, Apr 16, 2009 at 6:01 PM, dziobacz aaabbbcccda...@gmail.com wrote:

  I have:

  span id='57'

  bla bla bla br/
  a href='#'  something1 /abr/
  a href='#' onclick='clickk(57); return false;' DELETE /a
  br/br/

  /span

  How can I delete span element with id=57 and also everything inside ?