Helma logo
helma.org » Home > Stories > encodeForm()

encodeForm()

Replaces special characters in a string with their equivalent HTML entities.

Similar to encode() this function substitutes HTML entities but leaves linebreaks untouched. This is what you usually want to do for encoding form content (esp. with text input values).

Syntax
encodeForm(String)

Example
var str = encodeForm("<b>Bananer växer\n minsann inte på träd.</b>");
res.write(str);
&lt;b&gt;Bananer v&auml;xer
minsann inte p&aring; tr&auml;d.&lt;/b&gt;


... comment


Page last modified on 2002-07-16 11:58 by hns