File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSF
Bookmark "Javascript inside JSF problem" Watch "Javascript inside JSF problem" New topic

Javascript inside JSF problem

karthik manick
Ranch Hand

Joined: Aug 25, 2009
Posts: 53
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

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

Then in your js method, add

Hope it works.

If it doesnt, send me you code.


Member of TheDaedals Club
I agree. Here's the link:
subject: Javascript inside JSF problem