Link to home
Start Free TrialLog in
Avatar of Jagadeesh M
Jagadeesh MFlag for United States of America

asked on

Reset a struts form with out the page being refreshed

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
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland 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 Jagadeesh M

ASKER

Sounds good....but how do i reset a multi selectable list with javascript...!!
<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>
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
:-)