struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From IS Struts <IS.Str...@ftc.fiserv.com>
Subject RE: Default Button
Date Mon, 13 May 2002 20:20:56 GMT
Tony,
   I understand creating the tag, but I am not sure how to include the following line into
a Struts submit button.

  <ccom:MapEnterKey location="javascript:submitForm()"/>

Thanks,
Rich


>>> Tony.Hardee@ps.net 05/07/02 08:38AM >>>

I have a tag that generates java script.  Below is the relevant code from
the tag

            out.println("");
            out.println("<!-- Map Enter Key - BEGIN -->");
            out.println("<SCRIPT LANGUAGE=\"JavaScript\">");
            out.println("<!--");
            out.println("  function getKey(keyStroke) {");
            out.println("    isNetscape=(document.layers);");
            out.println("    eventChooser = (isNetscape) ? keyStroke.which :
event.keyCode;");
            out.println("    if (eventChooser == 13) {");
            out.println("      window.location=\"" + location + "\";");
            out.println("    }");
            out.println("  }");
            out.println("  document.onkeypress = getKey;");
            out.println("-->");
            out.println("</script>");
            out.println("<!-- Map Enter Key - END -->");
            out.println("");

To use the code/tag in the jsp I simply type

	<ccom:MapEnterKey location="javascript:submitForm()"/>

Hope this helps.


-----Original Message-----
From: James Mitchell [mailto:jmitchtx@telocity.com] 
Sent: Tuesday, May 07, 2002 10:33 AM
To: Struts Users Mailing List
Subject: RE: Default Button


There is no default.

When the user hits enter in any input field (except textarea) the enclosing
form is submitted.

JM




> -----Original Message-----
> From: IS Struts [mailto:Struts@firsttrust.com] 
> Sent: Tuesday, May 07, 2002 10:26 AM
> To: struts-user@jakarta.apache.org 
> Subject: Default Button
>
>
> How do you make a button a default button on a JSP, so when the
> user hits the 'Enter' key the button is submitted?
>
> Any suggestions are appreciated,
> Rich
>
>
> --
> 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>




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


Mime
View raw message