NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: JohanR on June 14, 2013, 02:41:08 AM
-
Hi,
I have a comment field that I would like to use to display some info to the user.
I have tried a variety of things but not getting the desired results.
How to display a piece of HTML on a form?
Do I use a text or display field?
Does it need complete HTML headers?
thanks
Johan
-
>> How to display a piece of HTML on a form?
use a form-field, "Display" type, with "Allow xHTML" turned on.
>> Does it need complete HTML headers?
no, it's not an HTML page, it's an HTML field. So just a simple HTML snippet will be fine.
cheers
Bruce
-
Hi Bruce
Exactly what I started with, but after that failed it went downhill from there.
All I am getting is the HTML being displayed in the field.
This is my field being loaded
loc:scr_memo = '<html><p>' & |
'Transaction failed' & '<br>' & |
'Response :' & clip(cct:result) & '<br>' & |
'Date :' & format(today(),@d05) & '<br>' & |
'Time :' & format(clock(),@t06) & '<br>' & |
'Result Code :' & clip(cct:code) & '<br>' & |
'--------------------------' & '<br>' & '</p></html>'
and this is from the browser firebug window
<div class=" vc_hdr_1" id="loc:scr_memo"><html><p>Transaction failed<br>Response :<br>Date :14/06/13<br>Time :01:53:36PM<br>Result Code :<br>--------------------------<br></p></html></div>
Perhaps I am not formatting the string correctly?
The xHtml tick is def on.
thanks
Johan
-
xHTML <> HTML.
Your code is HTML, and it needs to be xHTML.
a simple
loc:scr_memo = p_web.HtmlToXhtml( loc:scr_memo)
may be enough - although it's certainly not a universal fix. (it just fixes some common mistakes like you using <br> instead of <br/>.
If you still have no joy, edit one of the examples and post it.
cheers
Bruce
-
Hi Bruce
Thanks!
Sorry , forgot the crucial part about html and xhtml.
Changed my code, still did not work and eventually found the problem.
I started with the block of code with <html> and closed with </html>
The html tag not needed at all
Johan