I need to submit a form using jQuery, but before submitting it I want to change the value of one of the form fields without showing the change to the user. I know this is not the best way, but my software requires it.
I am currently using:
var submit = $("#submitform").serialize();
To serialize the data and then send it using
$.post('/post', submit)
I have serialized data:
entry%5Bbody%5D=hello+and+welcome&addedContexts=presentation&context=prese ntation&selectedContexts=&statementid=×tamp=
I just want to change the entry%5Bbody%5D value to something else.
I know that I can use Regex in a string (I canโt find what?), But maybe you know a more elegant solution? For example, first serializing the form, then deserializing it, changing the desired value and serializing it again?
Thanks!
source share