9. Text
<?
var @t: text
@t := "Hello"
@t := @t + " there."
@t := ToUpper(@t)
?>Postback
<? register input @TextProperty ?>
<input type="text" name="<?attr OutputId(@TextProperty) ?>" value="<?attr @TextProperty ?>"><? register input @TextProperty ?>
<input type="hidden" id="<?attr OutputId(@TextProperty) ?>" name="<?attr OutputId(@TextProperty) ?>">
<? startupscript ?>
// It is important to use 'js' encoding when outputting the property value in JavaScript blocks.
let value = <?js @TextProperty ?>;
value = value.toUpperCase();
console.log("Result in uppercase:", value);
<? end ?>
<? submitscript ?>
const el = document.getElementById(<?js OutputId(@TextProperty) ?>);
// Performing a postback with the text property is straightforward.
el.value = "Hi, can you post me back please? ♡";
<? end ?>Print Output Overview
Encoding
Output
Last updated
Was this helpful?