Link to home
Start Free TrialLog in
Avatar of Sathish David  Kumar N
Sathish David Kumar NFlag for India

asked on

how to call same page in struts

I develop one jsp  page  that contain 3 html:link and one button
if i click the button means that will call the  java script function and add one row ...
but give button  action as same page .so  that created row will disappear
how can i give the action in the same page  ?

<SCRIPT type="text/javascript">
function addRow()
{
alert("hi");
var newRow=document.all("tbl").insertRow();
var oCell = newRow.insertCell();
var oCell = newRow.insertCell();
 oCell.innerHTML = "<input type='text' name='t1'>";
 
 
}
 
 
</SCRIPT>
 
 
<TITLE></TITLE>
</HEAD>
 
<BODY>
 
<html:form action="/project.do">
<html:hidden property="res" value="0" name="res"/>
<center> Project Details </center>
	<CENTER>
	<TABLE border="0"id="tbl">
		<TBODY>
		
		
		
			<TR>
				<TD>Comapany Name</TD>
				<TD><html:select property="name"></html:select></TD>
			</TR>
			<TR>
				<TD>Project</TD>
				<TD><html:text property="pro"></html:text></TD>
			</TR>
			<TR>
				<TD>Technologies</TD>
				<TD><html:text property="tech"></html:text></TD>
			</TR>
			<TR>
				<TD>Database</TD>
				<TD><html:text property="db"></html:text></TD>
			</TR>
			<TR>
				<TD>Role</TD>
				<TD><html:text property="role"></html:text></TD>
			</TR>
			<TR>
				<TD>Descrpition</TD>
				<TD><html:text property="desc"></html:text></TD>
			</TR>
			<TR>
				<TD>Responsibilities</TD>
				<TD><html:text property="res"></html:text></TD>
				<td><html:submit value="AddRow" onclick="addRow()"></html:submit></td>
			
			</TR>
		</TBODY>
	</TABLE>
	</CENTER>
	
	<table align="center" id="tbl1">
	<TR>
			<TD><html:link page="/project.do?parameter=add"> Add page</html:link></TD>
			<td></td><td></td>	<TD><html:link page="/project.do?parameter=edit">Edit Page</html:link></TD>
		<td></td><td></td>	<TD><html:link page="/project.do?parameter=next">Next Page</html:link></TD>
     </TR>
		
	</table>
	
	
	
</html:form>
</BODY>
</html:html>

Open in new window

SOLUTION
Avatar of cmalakar
cmalakar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sathish David  Kumar N

ASKER

<TR>
                        <TD>Responsibilities</TD>
                        <TD><html:text property="res"></html:text></TD>
            <td><html:submit value="AddRow" onclick="addRow()"></html:submit></td>
                  
                  </TR>
i f i click the submit button then javascript  function will call after that form action perform  !!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial