Tags:
create new tag
view all tags

SID-01515: Escaping hiddent text on Form Save

Status: Answered 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:

&#37;INCLUDE{&quot;GDAdvertisingPhotography&quot; TOPICFORM=&quot;&#37;TOPIC&#37;&quot;}&#37;

See example form with visible input field at CreateTopicOnFormSubmit.

-- PeterThoeny - 2012-08-03

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title Escaping hiddent text on Form Save
SupportCategory CategoryForms
TWiki version 4.3.2
Server OS CentOS
Web server Apache
Perl version 5.8.8
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2012-08-03 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.