cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonid Chumanov" <lchuma...@framedoc.ru>
Subject Forms, multiply action widgets and ENTER key
Date Mon, 12 Jan 2009 09:07:39 GMT
Hi, All.

 

I working with CFORMS (cocoon 2.1.11).

 

I have some forms with more than one submit (or action) widgets.  When I
press ENTER (keyboard key) in text field - the form was submitted well.  

My problem: received submitId is id from first action widget in my form.
But I need it from action widget named "apply". 

How can I do this?

 

I try to use simple javascript

 

if (document.layers)

  document.captureEvents(Event.KEYDOWN);

  document.onkeydown =

    function (evt) { 

      var keyCode = evt ? (evt.which ? evt.which : evt.keyCode) :
event.keyCode;

      if (keyCode == 13)   //13 = the code for pressing ENTER 

      {

                        var applyButton = document.getElementById('apply');

                        if (applyButton != null){

                                   applyButton.click();

                        }

                        //

           //document.forms[0].submit(); - this working, but not well 

      }

    }

 

But this javascript does not working well.   

 

 

Thanks.   

Leonid


Mime
View raw message