Re: [Rails] Duplicate forms after click

2012-01-06 Thread Javier Quarite
On Fri, Jan 6, 2012 at 2:26 PM, Hassan Schroeder wrote: > On Fri, Jan 6, 2012 at 10:31 AM, Javier Quarite > wrote: > > > The scenario is a ... Exam Question, wich has 4 alternatives. After > click on > > an alternative it automatically saves/updates(only happens if its already > > checked) > > I

Re: [Rails] Duplicate forms after click

2012-01-06 Thread Hassan Schroeder
On Fri, Jan 6, 2012 at 10:31 AM, Javier Quarite wrote: > The scenario is a ... Exam Question, wich has 4 alternatives. After click on > an alternative it automatically saves/updates(only happens if its already > checked) If you just want to save the state of that radio button, why are you return

Re: [Rails] Duplicate forms after click

2012-01-06 Thread Javier Quarite
On Fri, Jan 6, 2012 at 8:43 AM, Daniel Negri wrote: > I'm using the very old trick: > > // Prevent double click > > $('form').submit(function(){ > > $('input[type=submit]', this).attr('disabled', 'disabled'); > > }); > > That would work if I had a submit button =) The scenario is a ... Exam Que

Re: [Rails] Duplicate forms after click

2012-01-06 Thread Daniel Negri
t it when a partial > is loaded then just include a bit of javascript in that partial that resets > the variable. > > ** ** > > ** ** > > *Fra:* rubyonrails-talk@googlegroups.com [mailto: > rubyonrails-talk@googlegroups.com] *På vegne af *Javier Quarite > *Sen

SV: [Rails] Duplicate forms after click

2012-01-06 Thread Brynjolfur Thorvardsson
lto:rubyonrails-talk@googlegroups.com] På vegne af Javier Quarite Sendt: 6. januar 2012 12:44 Til: rubyonrails-talk@googlegroups.com Emne: Re: [Rails] Duplicate forms after click On Fri, Jan 6, 2012 at 2:00 AM, Brynjolfur Thorvardsson mailto:bi...@itanet.nu>> wrote: Hi, this sounds like a java

Re: [Rails] Duplicate forms after click

2012-01-06 Thread Javier Quarite
On Fri, Jan 6, 2012 at 2:00 AM, Brynjolfur Thorvardsson wrote: > Hi, this sounds like a javascript problem. Javascript is executed > asynchroniously on your browser so clicking fast means that you are sending > more than one submit from the same form, causing Rails to return more than > once from

SV: [Rails] Duplicate forms after click

2012-01-05 Thread Brynjolfur Thorvardsson
is to put in a delay of say half a second in your javascript submit code. Fra: rubyonrails-talk@googlegroups.com [mailto:rubyonrails-talk@googlegroups.com] På vegne af Javier Quarite Sendt: 5. januar 2012 17:55 Til: rubyonrails-talk@googlegroups.com Emne: Re: [Rails] Duplicate forms after click

Re: [Rails] Duplicate forms after click

2012-01-05 Thread Javier Quarite
On Thu, Jan 5, 2012 at 11:44 AM, Colin Law wrote: > > Look in the rails log to see what is happening (development.log > assuming in development mode). > Once you understand what is happening you will be better placed to fix it. > > Colin > > Yes, I've done that and every time I click on that radi

Re: [Rails] Duplicate forms after click

2012-01-05 Thread Colin Law
On 5 January 2012 16:33, JavierQQ wrote: > > I'm having a problem with a submit event > What I'm trying to do is to update a record using radio inputs... and > everything is ok, but when I do a fast double-click on the radio > button, the form duplicates and I'm not sure if its a javascript > prob

[Rails] Duplicate forms after click

2012-01-05 Thread JavierQQ
I'm having a problem with a submit event What I'm trying to do is to update a record using radio inputs... and everything is ok, but when I do a fast double-click on the radio button, the form duplicates and I'm not sure if its a javascript problem or a rails problem cause its rendering the partia