I whipped this together, tested and confirmed:
document.observe("dom:loaded", function () {
$('login_form').observe('keydown', function (e) {
if ( e.keyCode == 13 ) {
//event.findElement('form').submit();
alert($F('login_str'));
}
});
}, false);
the form i set up looks like:
<form id=login_form>
<input type=text id=login_str>
</form>
On Wed, Dec 10, 2008 at 11:11 AM, Hector Virgen <[EMAIL PROTECTED]> wrote:
> This is untested, but I would probably do something like this:
>
> $$('form[name=login_form]').invoke('observe', 'keydown', function(event)
> {
> if (event.keyCode === 13) {
> event.findElement('form').submit();
> }
> });
>
> -Hector
>
>
> On Wed, Dec 10, 2008 at 4:46 AM, Dave L <[EMAIL PROTECTED]> wrote:
>>
>> Im not sure I understand. login_form is the id of the form that I am
>> trying to submit. and form_submit is the id of the actual submit
>> button. I tried the following:
>>
>> document.form.login_form.onkeydown="if(event.keyCode==13)
>> {this.form.submit();return false;};"
>>
>> and also
>>
>> $('login_form').form_submit.onkeydown="if(event.keyCode==13)
>> {this.form.submit();return false;};"
>>
>> but no go. Thanks for your input.
>>
>> On Dec 10, 1:03 am, "pradeep saraswati" <[EMAIL PROTECTED]> wrote:
>> > > hai
>> >
>> > u are using $('form_submit') --------does form_submit is the id of the
>> > form....
>> >
>> > then it will surely does not gonna work in I.E
>> >
>> > so you specify a name to the form....and access the form....
>> >
>> > document.form.formname.onkeydown--------> this will work in ie...
>> >
>> > i too faced this issue....just try this u r problem will be solved....
>> >
>> > if u are too much particular in accessing form using $...then use $F and
>> > never access form using the id
>> > IE will never know..what you are doing...if you access form by id
>> >
>> > Regards
>> > spradeepkumar
>>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---