It should work. What is your detail?
 
test.jsp
====================================================================
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
<SCRIPT LANGUAGE="Javascript">
function removeRole(form){
 alert("It works!");
 form.submit();
}
</SCRIPT>
</head>
<html:form action="/myTest.do" method=POST>
<html:button property="f1" value=">>" />
</html:form>
</html:html>
====================================================================
 
 config in struts-config.xml
======================================================================
<form-bean name="testForm"
    type="my.package.TestForm"/>
 
<action path="/myTest"
    type="my.package.ShowTestAction"
    name="testForm"
    scope="request">
    <forward name="success" path="/test/test.jsp" />
    <forward name="failure" path="/test/test-error.jsp"/>
</action>
====================================================================
----- Original Message -----
Sent: Tuesday, September 11, 2001 10:37 PM
Subject: RE: javascript in <html:button>

it works in html tag, but when I convert select tag and button tag to struts tag, I haven't touch javascrip, it doesn't work. any further suggestion?
Thanks
Frank
-----Original Message-----
From: Jishan Li [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 11, 2001 2:22 AM
To: [EMAIL PROTECTED]
Subject: Re: javascript in <html:button>

It really works for me.
----- Original Message -----
Sent: Tuesday, September 11, 2001 12:46 AM
Subject: javascript in <html:button>

I am using struts 1.0, I am trying to use javascript to pick user privilege from a available privilege list to selected list like following :

  <html:button property="addrole" value=" >> " /><br><br>
  <html:button property="del" value="  <<  " />
but it doesn't work, I remember on struts home page it mention that struts 1.0 doesn't support javascript things even <html:button> has onclick attribute,

 who might know something about it , how to get around it?
Thanks
Frank

-----Original Message-----
From: Julia Yang [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 10:26 AM
To: [EMAIL PROTECTED]
Subject: Does struts validate input field in JSP type by itself ?


Hi, all
Do you know if struts validate input fields in JSP by itself, which has
matched getter and setter methods in bean,?
For example: You have field called companyID in JSP and in you xxxForm
bean you have
        int companyID();
        public int getCompanyID(){
                return this.companmyID;}
        public void setCompanyID(int newCompanyID) {
                this.companyID = companyID}
My question is: if I put a String in JSP companyID field, can I let
struts tell me error message that companyID has to be integer ? How ?

Thanks

Julia
       

Reply via email to