Serialising a form data in jquery gives unnecessary symbols.How to avoid them?

Viewed 36

Serialise() function in jquery adds unnecessary symbols to the data.

In my script i'm doing serialize() in jquery .Then sending this value to another php file through jquery ajax function as one of the parameter.Then inserting into database through queries.The variables are converting into unnecessary variables.Please let me know how to resolve this issue.

$params = $("#admit_order").serialize()

Actual Result : 1152%2BHidden%2BRidge Expected Result : 115 Hidden Bridge

1 Answers

You can decode the serialised data by using decodeURIComponent().

  $params = $("#admit_order").serialize();
  decodeURIComponent($params);
Related