Is there a way to check the parameter if its empty or not before submitting?
Using pure javascript, it would be something like - (untested)
var form = document.forms[0];
form.onsubmit=function(){
var inputs, index;
inputs = document.getElementsByTagName('input');
for (index = 0; index < inputs.length; ++index) {
if(inputs[index].value == ''){
form.removeChild(inputs[index]);
}
}
}
Using jQuery, it would be something like - (untested)
$('form').submit(function() {
$('input').each(function(){
if($(this).val() == ''){
$(this).remove();
}
});
});