<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %><html:html>
<head>
<title><bean:message key="registrationForm.title"/></title>
<html:base/>
</head>
<body bgcolor="white"><logic:messagesPresent>
<bean:message key="errors.header"/>
<ul>
<html:messages id="error">
<li><bean:write name="error"/></li>
</html:messages>
</ul><hr>
</logic:messagesPresent><html:form action="registration-submit" onsubmit="return validateRegistrationForm(this);">
<html:hidden property="action"/><table border="0" width="100%">
<tr>
<th align="left">
<bean:message key="registrationForm.firstname.displayname"/>
</th>
<td align="left">
<html:text property="firstName" size="30" maxlength="30"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.lastname.displayname"/>
</th>
<td align="left">
<html:text property="lastName" size="60" maxlength="60"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.addr.displayname"/>
</th>
<td align="left">
<html:textarea property="addr" cols="40" rows="5"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.city.displayname"/>
</th>
<td align="left">
<html:text property="cityStateZip.city" size="60" maxlength="60"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.stateprov.displayname"/>
</th>
<td align="left">
<html:text property="cityStateZip.stateProv" size="60" maxlength="60"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.zippostal.displayname"/>
</th>
<td align="left">
<html:text property="cityStateZip.zipPostal[1]" size="25" maxlength="25"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.phone.displayname"/>
</th>
<td align="left">
<html:text property="phone" size="20" maxlength="20"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.email.displayname"/>
</th>
<td align="left">
<html:text property="email" size="60" maxlength="60"/>
</td>
</tr>
<tr colspan="1">
<td>
<html:submit property="submit" onclick="bCancel=false;">
<bean:message key="button.save"/>
</html:submit>
<html:reset>
<bean:message key="button.reset"/>
</html:reset>
<html:cancel onclick="bCancel=true;">
<bean:message key="button.cancel"/>
</html:cancel>
</td>
</tr>
</table>
</html:form><%--
Referencing the registrationForm since they are identical
so I don't need a separate validation.xml listing just for this form.
--%>
<html:javascript formName="registrationForm"/></body>
</html:html>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %><html:html>
<head>
<title><bean:message key="registrationForm.title"/></title>
<html:base/>
</head>
<body bgcolor="white"><logic:messagesPresent>
<bean:message key="errors.header"/>
<ul>
<html:messages id="error">
<li><bean:write name="error"/></li>
</html:messages>
</ul><hr>
</logic:messagesPresent><html:form action="registration-submit" onsubmit="return validateRegistrationForm(this);">
<html:hidden property="action"/><table border="0" width="100%">
<tr>
<th align="left">
<bean:message key="registrationForm.firstname.displayname"/>
</th>
<td align="left">
<html:text property="firstName" size="30" maxlength="30"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.lastname.displayname"/>
</th>
<td align="left">
<html:text property="lastName" size="60" maxlength="60"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.addr.displayname"/>
</th>
<td align="left">
<html:textarea property="addr" cols="40" rows="5"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.city.displayname"/>
</th>
<td align="left">
<html:text property="cityStateZip.city" size="60" maxlength="60"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.stateprov.displayname"/>
</th>
<td align="left">
<html:text property="cityStateZip.stateProv" size="60" maxlength="60"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.zippostal.displayname"/>
</th>
<td align="left">
<html:text property="cityStateZip.zipPostal[1]" size="25" maxlength="25"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.phone.displayname"/>
</th>
<td align="left">
<html:text property="phone" size="20" maxlength="20"/>
</td>
</tr>
<tr>
<th align="left">
<bean:message key="registrationForm.email.displayname"/>
</th>
<td align="left">
<html:text property="email" size="60" maxlength="60"/>
</td>
</tr>
<tr colspan="1">
<td>
<html:submit property="submit" onclick="bCancel=false;">
<bean:message key="button.save"/>
</html:submit>
<html:reset>
<bean:message key="button.reset"/>
</html:reset>
<html:cancel onclick="bCancel=true;">
<bean:message key="button.cancel"/>
</html:cancel>
</td>
</tr>
</table>
</html:form><%--
Referencing the registrationForm since they are identical
so I don't need a separate validation.xml listing just for this form.
--%>
<html:javascript formName="registrationForm"/></body>
</html:html>
function strDateTime(str)
{
var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
if(r==null)return false;
var d= new Date(r[1], r[3]-1, r[4]);
return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]);
}
2.3 长时间,形如 (2003-12-05 13:04:06)
function strDateTime(str)
{
var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;
var r = str.match(reg);
if(r==null)return false;
var d= new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]);
return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]&&d.getHours()==r[5]&&d.getMinutes()==r[6]&&d.getSeconds()==r[7]);
}
你是怎么用的?只是粘贴上了?