Re: enter disable

2002-11-20 Thread Joe Polanik
Gemes Tibor wrote:

2002. november 15. 13:06 dátummal Gus Delgado ezt írtad:


How can I disable the 


delete the submit button, put on a button which submits the form onClick.
This way you workaround the default (which is rather handy on the other hand)



I've done something like this, but it was only partially successful.






function setDoThis(val) {
  document.forms[0].doThis.value=val;
  document.forms[0].submit();
}

This stopped the form from submitting if the user pressed enter *except* 
when a radio button had focus. (Don't ask me why.)

To stop that I added another function:

function getDoThis() {
  var todo = document.forms[0].doThis.value;
  //alert("DoThis: " + todo);
  if (todo == "") {
return false;
  }
  else {
return true;
  }
}

and I added the following to the 

onsubmit="return getDoThis()"


This all seems rather involved. Does anyone have a simpler way to do this?

Joseph Polanik



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



RE: enter enable [WAS: RE: enter disable]

2002-11-15 Thread Andrew Hill
Ah - so I switch it back to a submit button and register an onSubmit
handler.
Thanks. :-)

-Original Message-
From: Arron Bates [mailto:struts-user@;keyboardmonkey.com]
Sent: Friday, November 15, 2002 20:44
To: [EMAIL PROTECTED]
Subject: Re: enter enable [WAS: RE: enter disable]


err...

The "onSubmit" handler in your form tag.
Before the form is sent at all, this will be called whether you've hit
enter and image submit or whatever.

Return false from this script, then it will not process the form at all.
Return true, and it will play like normal.


Arron.

On Fri, 2002-11-15 at 23:40, Andrew Hill wrote:
> Funnily enough I have the opposite problem.
> I have a form that now uses a button or sometimes a link instead of a
> submitButton to submit the form as it needs to do some stuff in javascript
> prior to submission (including playing silly buggers with the forms action
> property!).
> This works fine except that in dropping the submit in favour of a plain
> button Ive lost the 'submit on enter' behaviour.
> How might I get it back while still being able to do my js stuff when the
> user submits the form - including via 'enter'.?
>
> -Original Message-
> From: Gemes Tibor [mailto:gemes@;regens.hu]
> Sent: Friday, November 15, 2002 20:28
> To: Struts Users Mailing List
> Subject: Re: enter disable
>
>
> 2002. november 15. 13:06 dátummal Gus Delgado ezt írtad:
> > How can I disable the  > use hits the enter key. The way it works right now everytime you hit the
> > enter key in a text field it tries to submit the request.  any flags
> > that need to be turn off?
>
> delete the submit button, put on a button which submits the form onClick.
> This way you workaround the default (which is rather handy on the other
> hand)
>
> Tib
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@;jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Re: enter enable [WAS: RE: enter disable]

2002-11-15 Thread Gemes Tibor
2002. november 15. 13:40 dátummal Andrew Hill ezt írtad:
> Funnily enough I have the opposite problem.
> I have a form that now uses a button or sometimes a link instead of a
> submitButton to submit the form as it needs to do some stuff in javascript
> prior to submission (including playing silly buggers with the forms action
> property!).
> This works fine except that in dropping the submit in favour of a plain
> button Ive lost the 'submit on enter' behaviour.
> How might I get it back while still being able to do my js stuff when the
> user submits the form - including via 'enter'.?

You should provide a submit button in this case, 
and onClick you do the stuff you'd like to, and if everything went well, 
return true. In this case the form will be submitted. 

I do usually 







Hth

Tib

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




enter enable [WAS: RE: enter disable]

2002-11-15 Thread Andrew Hill
Funnily enough I have the opposite problem.
I have a form that now uses a button or sometimes a link instead of a
submitButton to submit the form as it needs to do some stuff in javascript
prior to submission (including playing silly buggers with the forms action
property!).
This works fine except that in dropping the submit in favour of a plain
button Ive lost the 'submit on enter' behaviour.
How might I get it back while still being able to do my js stuff when the
user submits the form - including via 'enter'.?

-Original Message-
From: Gemes Tibor [mailto:gemes@;regens.hu]
Sent: Friday, November 15, 2002 20:28
To: Struts Users Mailing List
Subject: Re: enter disable


2002. november 15. 13:06 dátummal Gus Delgado ezt írtad:
> How can I disable the  use hits the enter key. The way it works right now everytime you hit the
> enter key in a text field it tries to submit the request.  any flags
> that need to be turn off?

delete the submit button, put on a button which submits the form onClick.
This way you workaround the default (which is rather handy on the other
hand)

Tib


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Re: enter disable

2002-11-15 Thread Gemes Tibor
2002. november 15. 13:06 dátummal Gus Delgado ezt írtad:
> How can I disable the  use hits the enter key. The way it works right now everytime you hit the
> enter key in a text field it tries to submit the request.  any flags
> that need to be turn off?

delete the submit button, put on a button which submits the form onClick.
This way you workaround the default (which is rather handy on the other hand)

Tib


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: enter disable

2002-11-15 Thread Miguel Angel Mulero Martinez
This is JavaScript code. I don't know how, but search information about it.

Regards,
Miguel

-Mensaje original-
De: Gus Delgado [mailto:gdelgado@;oceanobjects.com]
Enviado el: viernes, 15 de noviembre de 2002 13:06
Para: Struts Users Mailing List
Asunto: enter disable


How can I disable the mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: