aspose file tools*
The moose likes JSF and the fly likes Javascript inside JSF problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Javascript inside JSF problem" Watch "Javascript inside JSF problem" New topic
Author

Javascript inside JSF problem

karthik manick
Ranch Hand

Joined: Aug 25, 2009
Posts: 52
i am using a form which has a button "Edit" which on clicking should display 2 dropdown list.
i have hidden the dropdown by using <div style="display:none">to the div which is surrounding the dropdown. i have given onclick of command button as onclick="show(div)" so that it will show the dropdown list when the user clicks the Command button.
my problem is when i click the command button , it is calling the javascript "show" and showing the dropdown for a second and again refreshing the page to show only the command button. i dont know why the page is getting refreshing again.
If i keep the commandbutton outside form , the hide/show are working fine.
please help.
Akash Singla
Greenhorn

Joined: Jul 22, 2009
Posts: 27
Try this,



Then in your js method, add



Hope it works.

If it doesnt, send me you code.

Akash
TheDaedals


Member of TheDaedals Club
http://www.thedaedals.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript inside JSF problem