• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to reset s:select

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

This post is related to https://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 ??
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic