Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Checkform

843836Jun 23 2005 — edited Jun 24 2005
I am using struts and want to use javascript to validate the values put into the
form. so far its not working properly.
Thanks ahead.

<%@ taglib uri = "http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri = "http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri = "http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<html>
<body>
<html:form action="/sendPhone" method="post">
<table>
<tr>
wfff wertyi5 <td >Name:</td>
<td><html:text property="phone"/></td>
</tr>
</table>

<input type="submit" onclick="javascript:doSomeFunction()"/>

</html:form>

<SCRIPT language="JavaScript" type="text/javascript">
function doSomeFunction(){

form[0].submit();//This line can be taken out and the form still submits I dont want this to happen.


}
</script>

</body>
</html>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 22 2005
Added on Jun 23 2005
5 comments
175 views