Search code examples
javascriptcoldfusion-2016

URL Encoding : Javascript


I have a javascript capturing signatures and data. The " are getting lost/cutoff and not conserving. I assume this is a URLEncoding issue.

This is the original.

     '<input type="hidden" name="rvnotes" value="' + rvnotes + '"/>' +

And I have tried this, but still no luck. Any idea how to URL Encode the Javascript submission.

     '<input type="hidden" name="rvnotes" value="' + encodeURIComponent(rvnotes) + '"/>' +

Solution

  • The trick must be done in <form>.

    <form enctype="application/x-www-form-urlencoded" ...>