$('form').on('submit', function(submitEvent)
{
$('table[id*=OtherOptions] :input').attr('disabled', false);
$('#collapsiblePanel :input').attr('disabled', false);
if (preventSubmit)
{
submitEvent.preventDefault();
populateDateValues();
populateContextFilterValues();
if($.browser.msie)
{
$('#collapsiblePanelHiddenValues').val(JSON.stringify(collapsiblePanelObj));
}
var form = $(this);
var formInput = decodeURIComponent(form.serialize());
$.getJSON('ValidateParams', formInput, function(data)
{
// Some more code here...
In the above code i am making the validation call to a struts2 action with the form data but if some form field contains # or % as value then while getting the request parameters on the server side all the parameters after these special characters do not come in the request parameter map.
What could be the solution to the above problem?
I was able to resolve the issue by not calling the decodeURIComponent and only sending the serialized form data to server side where the encoded data is automatically decoded by struts2.