NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Mike Grigsby on April 27, 2008, 12:36:19 PM

Title: Display text all bunched up. I think it used to work
Post by: Mike Grigsby on April 27, 2008, 12:36:19 PM
I'm having trouble with two problems surrounding text boxes:

1. No matter how wide (cols) I make the text box, it stays the same small width, even though fields in the same colume of the form page are wider. Viewing the html page source shows the correct columns, but there's so much other stuff in the field that I can't tell what might be breaking it.

2. My text boxes are 10,000 characters long (I know, not the best use of resources), but there are not many of them. I'm using a special "View" page to look at the text which displays the field as a "display". The html page source shows all the text as with spaces as it should appear, but there are no html breaks. Is there a function I can call to turn two carriage returns and line feeds into <p /> and <br />'s before they are displayed?

I thought this was previously working correctly, and don't know if something changed in the latest NT release.
Title: Re: Display text all bunched up. I think it used to work
Post by: ccordes on April 28, 2008, 06:58:02 AM
Hi Mike,

Without a look at it, it is hard to say. The way you describe it, though, it sounds like a css issue. What styles are influencing the text? Sometimes it isn't always immediately apparent.

I use web developer plug in for Firefox to display all the style info.

chris c
Title: Re: Display text all bunched up. I think it used to work
Post by: Mike Grigsby on April 28, 2008, 08:19:05 AM
Thanks Chris, I hadn't considered it a CSS issue. I'll run Firebug against it and see what it has to say.
Title: Re: Display text all bunched up. I think it used to work
Post by: Mike Grigsby on April 28, 2008, 08:57:52 AM
Well, the CSS looks fine... just what the defaults are for a typical all.css.

The thing I realized is that it does take HTML, like <br /> and <p />, and it uses those to format the text, so it's acting like it should allow HTML, even though there is no option to tell it that.

So, I think NTWeb automatically treats a display field as XHTML, and it would be nice if there was an option not to, just as you can turn XHTML on or off for a text box.
Title: Re: Display text all bunched up. I think it used to work
Post by: Mike Grigsby on April 28, 2008, 09:28:16 AM
So to unbunch my "display" text, I just put this in the Procedure Setup:

 L:JobDescription=REQ:JobDescription
 LOOP
   IF INSTRING('<13,10>',L:JobDescription,1,1)
     s#=INSTRING('<13,10>',L:JobDescription,1,1)
     L:JobDescription=SUB(L:JobDescription,1,s#-1) & '<br />' & SUB(L:JobDescription,s#+2,10000)
   ELSE
     BREAK
   END
 END
Title: Re: Display text all bunched up. I think it used to work
Post by: Mike Grigsby on April 28, 2008, 09:42:20 AM
Gotta add a PLUS about doing it this way that I hadn't thought of until I started using it. By manually replacing <13,10> with <br />, it allows HTML formatting to be done in the text box. Very useful.