[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Reset a struts form with out the page being refreshed

Posted on 2007-10-10
5
Medium Priority
?
607 Views
Last Modified: 2013-11-23
Hi -
I need to clear my struts form without refreshing the screen. But for some reason when i use the reset button on my form....it refreshes the screen.

I've couple of text boxes and couple of multiple selectable lists in my form. All I need is a reset button that should reset the form with out the page being refreshed.

Sample code is appreciated.

Thank You
0
Comment
Question by:jagadeesh_motamarri
  • 3
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 20047780
Why not reset the fields with Javascript?
0
 
LVL 10

Author Comment

by:jagadeesh_motamarri
ID: 20048345
Sounds good....but how do i reset a multi selectable list with javascript...!!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20049794
<script type="text/javascript">
<!--
      function resetSelect(objID) {
            selObject=document.getElementById(objID)
            //cycle through the options collection, setting the selected attribute of each to false
            for (i=0;i < selObject.options.length;i++) {
                  selObject.options[i].selected=false;
            }

      }
//-->
</script>
0
 
LVL 4

Assisted Solution

by:TheMajestic
TheMajestic earned 1000 total points
ID: 20053971
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20544255
:-)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question