Reset a struts form with out the page being refreshed

Posted on 2007-10-10
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 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
Question by:jagadeesh_motamarri
    LVL 86

    Accepted Solution

    Why not reset the fields with Javascript?
    LVL 10

    Author Comment

    Sounds good....but how do i reset a multi selectable list with javascript...!!
    LVL 86

    Expert Comment

    <script type="text/javascript">
          function resetSelect(objID) {
                //cycle through the options collection, setting the selected attribute of each to false
                for (i=0;i < selObject.options.length;i++) {

    LVL 4

    Assisted Solution

    LVL 86

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    Title # Comments Views Activity
    copyEndy  challenge 15 37
    changePi Challenge 15 55
    word0 challenge 4 34
    Unexpected HttpURLConnection connection behavior 2 14
    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    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.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now