File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to reset s:select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to reset s:select" Watch "How to reset s:select" New topic
Author

How to reset s:select

Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183

This post is related to http://www.coderanch.com/t/453945/HTML-JavaScript/Javascript-struts

All my struts elements are reset using javascript reset function. However, it is not able to reset s:select. Is it something wrong that I am doing or does javascript reset not work for s:select.

If that is the case what is the workaround. A custom reset method ??
Roberto Hernandez
Ranch Hand

Joined: Apr 29, 2009
Posts: 33
Hey Jay,
Try to get your element by ID using javascript


then iterate over the select field options to remove them one by one;



Note: The Syntax could be a little different and may need some tweeking, but the concept is the same. Hope this helps
Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183

Yep, I was scared that I might have to do that..

Do you know if javascript reset can handle struts select. I have seen javascript reset handle almost all the other fields including struts checkboxes.

Thanks for your inputs Roberto.

Jay
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to reset s:select
 
Similar Threads
how to reset the struts html file upload filed?
Action within JSP
Dynamic width of s:select
Dynamic forms with javascript
how to get selected value from s:select tag in struts 2