SID-01515: Escaping hiddent text on Form Save
| Status: |
Answered |
TWiki version: |
4.3.2 |
Perl version: |
5.8.8 |
| Category: |
CategoryForms |
Server OS: |
CentOS |
Last update: |
13 years ago |
I have a form in a wiki page and I want to use a button to create (save) a new page with the following text
%INCLUDE{"GDAdvertisingPhotography" TOPICFORM="%TOPIC%"}%
But this doesn't work
<input type="hidden" name="text" value="%INCLUDE{"GDAdvertisingPhotography" TOPICFORM="%TOPIC%"}%">
--
DanielAjoy - 2012-08-03
Discussion and Answer
how should I escape the text so that the hidden input works?
--
DanielAjoy - 2012-08-03
You need to entity-encode the string in the hidden input field. There are web-based utilities such as
http://centricle.com/tools/html-entities/
to encode/decode text. You need to encode also the percent sign with
%, otherwise TWiki will expand variables on topic view of the page that has the form.
Your encoded string looks like:
%INCLUDE{"GDAdvertisingPhotography" TOPICFORM="%TOPIC%"}%
See example form with visible input field at
CreateTopicOnFormSubmit.
--
PeterThoeny - 2012-08-03
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.