wood burning stoves 2.0*
The moose likes Struts and the fly likes can we write javascript functions on struts tags? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "can we write javascript functions on struts tags?" Watch "can we write javascript functions on struts tags?" New topic
Author

can we write javascript functions on struts tags?

raja sekhar geda
Greenhorn

Joined: May 07, 2012
Posts: 2
can we write javascript functions on struts tags?

If yes, How to retrieve the struts tags values in java script functions?
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Hi Raja,

Welcome to JavaRanch!!!

raja sekhar geda wrote:can we write javascript functions on struts tags?

Can you explain more about the problem?


Have Fun with Java
little,little.. little by little makes a lot..
raja sekhar geda
Greenhorn

Joined: May 07, 2012
Posts: 2
<html>
<script type="text/javascript">
function rajasekhar(){
document.getElementById("first").value =document.getElementById("second").value;
alert(document.getElementById("first").value);
}
</script>
<form>
<input type="text" id="second"/>
<input type="text" id="first" />
<input type="submit" value="submit" onclick="rajasekhar();" />
</form>
</html>

Output :-- Here when i save the file with .html extension and when i open the file with browser then two text fields and button apper on the webpage . When i enter the first text box and click on the button then alert box will be displayed . on this alert second text box value will be displayed.




I want to perform the above Operations on pure Struts tags a:

<html>
<script type="text/javascript">
|
|
</script>
<body>
<form action="registration" method="post">
<html:text property="first" />
<html:text property="second"/>
<html:submit onclick="rajasekhar()" />
</form>
</html>


Now tell me the java script code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can we write javascript functions on struts tags?
 
Similar Threads
extending the default stuts tags
can we able to create struts html tags dynamically from javascript?
How can I trigger javascript function before submit struts 2
validation particular fields for different actions in a single page
calling functions in .js file