-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have one textbox. This textbox is of multiple lines. In java i have one string which hold data to show in HTML format. How can load that content in textbox without showing HTML tags.
Is there any way to do this ??
Thanks in advance.
You mean something like this?
<?page title="" contentType="text/html;charset=UTF-8"?>
<zk>
<script type="text/javascript"><![CDATA[
function removeHTMLTags() {
var strInputCode = $("$txtInput").val();
strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
return (p1 == "lt")? "<" : ">";
});
var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
$("$txtOutput").val(strTagStrippedText);
}
]]></script>
<window title="" border="none">
<vlayout>
<textbox id="txtInput" multiline="true" rows="10" width="500px" height="200px"
placeholder="Place here the HTML code"
onChanging='Clients.evalJavaScript("removeHTMLTags();")' />
<textbox id="txtOutput" multiline="true" rows="10" width="500px" height="200px"
placeholder="Output result" />
</vlayout>
</window>
</zk>
Hope that helps, Costas
Asked: 2014-06-06 12:54:16 +0800
Seen: 46 times
Last updated: Jun 06 '14
Zk textbox width inner HTML elements percentages
How to get HTML Components values into MVC Composer or MVVM View Model
embed zul file into html template
onBlur event is not sent when clicking on a Html component
Applet integration - How can i get the html tag id in javascript?