Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not able to write less than (<) in defined field

Status
Not open for further replies.

duffyMax

Programmer
Oct 3, 2007
1
US
DEFINE TABLE TEST
TAGA/A100 = '<option>';
TAGB/A100 = 'option>';
END
TABLE FILE TEST
PRINT TAGA
TAGB
END
-RUN

The results for TAGA is blank and for TAGB is option>

Seems like when focus sees '<' it just ignore the rest of the string entirely. Anyone knows how to include the '<' sign in the defined field? I'm on WebFocus 761. Thanks.
 
USE THIS CODE AN REPLACE THE FIELDS WITH TAGA AND TAGB IF DOES FIELDS ARE ALPHANUMERIC DON'T USE D_PRID DEFINE FIELD


DEFINE FILE SCO_PROCESSES
D_PRID/A10 = TRIM('B',FTOA(PROCESSES_ID,'(F10)',D_PRID),10,' ',1,'A10');
D_DESC/A100 = '<option value="'||D_PRID||'">'||PRO_CODE||'</option>';
END

TABLE FILE SCO_PROCESSES
PRINT
D_DESC
BY PRO_CODE NOPRINT
ON TABLE HOLD AS HTMP0001 FORMAT ALPHA
END


-HTMLFORM BEGIN
<html>
<body>
<select name="INT_PROC">
<option selected value="FOC_NONE">TODOS</option>
!IBI.FIL.HTMP0001;
</select>
</body>
</html>
 
This is NOT a WebFOCUS issue, but a BROWSER issue.

In WebFOCUS, when you don't specify an output format, the default is HTML. In this case, the '<option>' is interpreted by the BROWSER as a browser control, not data (right click on the output and select 'view source' and you can see it IS in the output), and the browser, since there's no data left, displays blanks. People use this technique to put 'custom' HTML controls into their output.

If you WANT all data to be URL encoded, so the browser will NOT think it's browser control, then issue the following first:

SET HTMLENCODE=ON

And ALL data will be encoded so it shows in the browser.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top