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.