hi my dear friends , how r u all,
friends can u please help me in this situation
i have a situation like this:
we are devoloping the application in
struts so in
jsp page when we click on a check box the textbox fields has to populate with some values
using
java script we can do this , but in struts we can not access java script
so can any one tell the java code to populate text fields when checked on check box.
this is jsp page code:
<%@ page language="java" import= "com.visage.struts.LookupForm" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<title>
Web Application Page
</title>
</head>
<body>
<%LookupForm fm=(LookupForm)session.getAttribute("theName");
String firstName = fm.getFirstName();
String mi = fm.getMiddleInitial();
String ln = fm.getLastName();
%>
<html:form action="Lookup1" >
<table border="3">
<table width="45%" border="1">
<tr>
<td>first name<td/>
<td><html:text property="firstName" value="<%= firstName %>"/></td>
</tr>
<tr>
<td>M.I<td/>
<td><html:text property="middleInitial" value="<%= mi %>"/></td>
</tr>
<tr>
<td>last name<td/>
<td><html:text property="lastName" value="<%= ln %>"/></td>
</tr>
<tr>
<td><html:submit/></td>
</tr>
</table>
<table border="3">
<table width="45%" border="1">
<tr align="right">
<input type=checkbox name=C1 > same as billing<br>
</tr>
<tr>
<td>first name<td/>
<td><html:text property="cfirstName" value=""/></td>
</tr>
<tr>
<td>M.I<td/>
<td><html:text property="cmiddleInitial" value=""/></td>
</tr>
<tr>
<td>last name<td/>
<td><html:text property="clastName" value=""/></td>
</tr>
</table>
</html:form>
</body>
</html>