• Post Reply Bookmark Topic Watch Topic
  • New Topic

Javascript inside JSF problem  RSS feed

 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this,



Then in your js method, add



Hope it works.

If it doesnt, send me you code.

Akash
TheDaedals
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!