On Oct 3, 2:11 pm, Tim Perrett <[EMAIL PROTECTED]> wrote:
> > I guess you could disable the submit button on first submit? ... on
> > server side you could get rid of the processing function from the
> > cache that is associated with that specific thing. However this kind
> > of seems unnecessary for your use-case ... maybe.
>
> Its funny you mention that Marius - not only 2 days ago was I trying
> to do something like this... I tried adding a
> onsubmit="submitonce(this);" (where submitonce is a function to
> disable the button) type javascript call into my markup but still,
> even with the previous change to allow custom snippet attributes, it
> was removed?

No, it is still there. But form snippet care about class and id
attributes not quite any custom attributes.

> So that didn't work, next I thought, ok no problem, i'll
> just use a jquery event handler! Whilst I could make it disable the
> button with something like:
>
> $(document).ready(function(event) {
>   $("form#delegateform").submit(function(event){
>     var elements = $
> ("form#delegateform").children("div").children("input")
>     for(i=0;i<elements.length;i++){
>       var tempobj = elements[i]
>       if(tempobj.type.toLowerCase()=="submit"){
>         tempobj.disabled=true
>       }
>     }
>     return true;
>   })
>
> });
>
> Which has the desired effect of disabling the form submit button, but
> it appears to screw with the actual data being posted. I didnt have
> enough time to explore what was happening :-(

I wonder if it works to disable the button asynchronously into a
setTimeout call so th form would be submitted and browser sould
execute th disable code after half of second  ... haven't tried it so
maybe it is a long shot.

>
> One would have thought this should be a fairly simple thing to want to
> do - and again, something front end designers should be able to do
> without needed to do anything server side as its a usability issue
> IMO.

I tend to agree that this case should be done from client side
(mostly). How about not disabling the button but make it
invisible? ... would that make a difference?

>
> Thoughts?
>
> Tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to