Jquery onlick refreshes the fields
===

I have a jsf dropdown that decides the fields to be populated onchange using Jquery

    $(document).ready(function(){
    //hide all in target div
	   $("div","div#fields").hide();
     $("#dbform\\:dbfields").change(function(){
        // hide previously shown in target div
             $("div","div#fields").hide();
       var value=    $("#dbform\\:dbfields").val();
        $("div#"+value).show();
        
      
    });
   
    });
 


But when i click on the submit button in the ("div#"+value) div tag, the jsf page refreshes and the controls disappear throwing an error saying fields cannot be empty. Not sure how to overcome this. I want the button to submit the event and populate other fields.