On Wed, Sep 17, 2008 at 5:21 PM, Tokeiito <[EMAIL PROTECTED]> wrote:
> this method form#disable()/enable() disables all form thats not what i'm
> searching.
>
> I'm searching how to disable submission on Enter key. User still can edit
> text in field, he still can submit form by clicking button, but he can't
> submit it with Key Enter. Everything is simple if its regular form. But how
> to do that in form created by Ajax.InPlaceEditor() ?


var doNotSubmit = function(e)
{
    return e.keyCode != Event.KEY_RETURN;
}

$('form').observe('submit', doNotSubmit);

PS: I didn't tested it :)

>
> Resectfully,
>
> Darius Tumas (a.k. Tokeiito)
>
> mob.: +370 631 13666
> www.tokeiito.eu
>
>
> 2008/9/17 bluezehn <[EMAIL PROTECTED]>
>>
>> There's a method on forms you want: form#disable() or form#enable().
>> Then it's just a case of finding the element. You could do this
>> through $$ or select() or have a look at the inplaceeditor source
>> code. As I remember, the form element is stored as something like
>> _form on each instance of the class. Extend the inplaceeditor and add
>> a function that looks like this:
>>
>> disable: function() { this._formElement.disable(); }
>>
>> and then you can call it from wherever.
>>
>> You may also want to extend and override the function which handles
>> the click on the submit button - currently the whole form dissapears
>> to show the word "saving..." which I didn't like either because it
>> makes validation even server side very different.
>>
>> On Sep 17, 7:43 pm, Tokeiito <[EMAIL PROTECTED]> wrote:
>> > Hello,
>> >
>> > I cant find any where, how to disable Ajax.InPlaceEditor(....); created
>> > form
>> > submission when user hits Enter key.
>> >
>> > Respectfull,
>> >
>> > Darius Tumas (a.k. Tokeiito)
>> >
>> > mob.: +370 631 13666www.tokeiito.eu
>>
>
>
> >
>



-- 
Believe nothing, no matter where you read it, or who said it, no
matter if I have said it, unless it agrees with your own reason and
your own common sense.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to